/* Merchant register */
html, body { height: 100%; }
body.app { overflow: hidden; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
#top { flex: none; position: relative; z-index: 5; }
#main { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; outline: none; }

/* shared paper tear */
.tape::after, .paid-slip::after, .z::after, .setup-card::after, .sale-paper .receipt::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 9px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M0 0h14L7 9z' fill='%23fff'/%3E%3C/svg%3E") repeat-x 0 0 / 14px 9px;
}

/* ---------- header ---------- */
.noren .brand { flex: 1 1 auto; }
.tabs { display: flex; gap: 0.2rem; }
.tab {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0.3rem 0.9rem;
  border-radius: 10px; color: rgba(255, 255, 255, .75); font-weight: 700; font-size: var(--t-sm); text-decoration: none;
}
.tab:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tab[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .16); }
.top-tools { display: flex; align-items: center; gap: 0.75rem; }
.net { display: inline-flex; align-items: center; gap: 0.45rem; max-width: 24ch; color: rgba(255, 255, 255, .85); font-size: var(--t-xs); font-weight: 700; }
.net .dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #8f9ab3; }
.net[data-state="ok"] .dot { background: #6fd08b; box-shadow: 0 0 0 3px rgba(111, 208, 139, .22); }
.net[data-state="bad"] .dot { background: #ff8a7a; }
.net-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- register ---------- */
.register {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 31vw, 400px); grid-template-rows: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem); height: 100%; padding: 1rem clamp(0.75rem, 2vw, 1.5rem) 1.25rem;
}
.pick { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.cats { flex: 1; min-width: 0; }
.pick-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 12px 1.25rem 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 0.85rem; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem;
  min-height: 108px; padding: 0.85rem 0.9rem 0.75rem; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-key);
  box-shadow: 0 4px 0 #c6cddb; transition: border-color .15s, transform .05s, box-shadow .05s;
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { border-color: #95a1ba; }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #c6cddb; }
.tile.in-cart { border-color: var(--ai); box-shadow: 0 4px 0 var(--ai); }
.tile.in-cart:active { box-shadow: 0 1px 0 var(--ai); }
.tile-name { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.tile-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.tile-price { font-family: var(--font-dot); font-size: var(--t-lg); }
.tile-tax { padding: 0 0.35em; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-soft); font-size: 0.72rem; font-weight: 700; }
.tile-qty {
  position: absolute; top: -10px; right: -10px; display: grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 7px; border-radius: 999px;
  background: var(--ai); color: #fff; font-family: var(--font-dot); font-size: var(--t-sm); box-shadow: 0 0 0 3px var(--mist);
}
.tile.bump .tile-qty { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.28); } }

/* keypad: a dark customer display over big keys */
.kp { display: grid; gap: 0.9rem; max-width: 460px; margin: 0 auto; }
.kp-screen { display: grid; gap: 0.6rem; padding: 1rem 1.1rem 0.9rem; border-radius: 14px; background: var(--ai-deep); color: #e8eeff; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .25); }
.kp-amount { display: block; font-family: var(--font-dot); font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.1; text-align: right; }
.kp-screen .kp-label { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.kp-screen .kp-label::placeholder { color: rgba(232, 238, 255, .55); }
.kp-rate { justify-self: center; }
.kp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.key {
  min-height: 64px; border: 1.5px solid var(--line); border-radius: var(--r-key); background: var(--paper); color: var(--ink);
  font-family: var(--font-dot); font-size: 1.75rem; cursor: pointer; box-shadow: 0 4px 0 #c6cddb; -webkit-tap-highlight-color: transparent;
}
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #c6cddb; }
.key-bs { display: grid; place-items: center; color: var(--ink-soft); }
.key-bs .ic { width: 1.6rem; height: 1.6rem; }
.kp-add { width: 100%; }

/* the receipt tape coming out of the printer slot */
.tape-col { position: relative; display: flex; flex-direction: column; min-height: 0; padding-top: 7px; }
.tape-col::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 16px; z-index: 1;
  border-radius: 8px; background: var(--ai-deep); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3);
}
.tape {
  position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 200px; margin: 0 14px;
  background: var(--paper); box-shadow: 0 12px 26px -20px rgba(24, 33, 63, .55);
}
.tape-top { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1rem 0.6rem; border-bottom: 1px dashed var(--line); color: var(--ink-soft); font-size: var(--t-xs); }
.tape-store { overflow: hidden; color: var(--ink); font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.tape-count { flex: none; font-family: var(--font-dot); }
.tape-lines { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0.2rem 1rem; list-style: none; }
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name amt" "unit step";
  gap: 0.1rem 0.75rem; padding: 0.55rem 0; border-bottom: 1px dotted var(--line);
}
.line:last-child { border-bottom: 0; }
.line-name { grid-area: name; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.rm { color: var(--ink-soft); font-weight: 400; }
.line-amt { grid-area: amt; font-family: var(--font-dot); font-size: var(--t-lg); text-align: right; }
.line-unit { grid-area: unit; align-self: center; color: var(--ink-soft); font-family: var(--font-dot); font-size: var(--t-xs); }
.line-tag { font-family: var(--font-ui); }
.stepper { grid-area: step; display: inline-flex; align-items: center; justify-self: end; gap: 0.2rem; }
.step { display: grid; place-items: center; width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); color: var(--ai); cursor: pointer; }
.step:hover { border-color: var(--ai); }
.step .ic { width: 1.1rem; height: 1.1rem; }
.qty { min-width: 2.2ch; text-align: center; font-family: var(--font-dot); font-size: var(--t-lg); }
.tape-empty { flex: 1; display: grid; place-items: center; margin: 0; padding: 2rem 1.25rem; color: var(--ink-soft); font-size: var(--t-sm); text-align: center; }
.tape-sum { padding: 0.6rem 1rem 1.1rem; border-top: 1px dashed var(--line); }
.sum-row { display: flex; justify-content: space-between; font-size: var(--t-sm); }
.sum-row span:last-child { font-family: var(--font-dot); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 700; }
.sum-total .amt { font-family: var(--font-dot); font-weight: 400; font-size: var(--t-3xl); line-height: 1.15; }
.sum-note { margin: 0.15rem 0 0; color: var(--ink-soft); font-size: var(--t-xs); text-align: right; }
.tape-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; margin-top: 24px; }
.charge-btn { min-height: 64px; font-size: var(--t-xl); }
.tape-bar, .sheet-scrim, .sheet-handle { display: none; }

/* ---------- charge overlay ---------- */
#overlay { position: fixed; inset: 0; z-index: 50; overflow: auto; background: var(--mist); }
.charge { display: flex; flex-direction: column; min-height: 100%; }
.charge-bill {
  position: relative; padding: 1.1rem 1rem 1.8rem; padding-top: max(1.1rem, env(safe-area-inset-top));
  background: var(--ai); color: #fff; text-align: center;
}
.charge-bill::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 11px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 3px), var(--mist) calc(20% - 3px) 20%);
}
.bill-no { margin: 0; font-size: var(--t-xs); letter-spacing: 0.04em; opacity: .78; }
.bill-amount { margin: 0.1rem 0 0; font-family: var(--font-dot); font-size: clamp(3rem, 9vw, 5.6rem); line-height: 1.05; }
.bill-desc { margin: 0.25rem 0 0; font-size: var(--t-sm); opacity: .85; }
.bill-test { display: inline-block; margin: 0.5rem 0 0; padding: 0.15rem 0.75rem; border-radius: 999px; background: #f6e7c6; color: var(--ochre-ink); font-size: var(--t-xs); font-weight: 700; }
.charge-stage {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: start;
  gap: clamp(1.25rem, 3vw, 2.5rem); width: 100%; max-width: 1080px; margin: 0 auto; padding: 1.75rem clamp(1rem, 4vw, 3rem) 2rem;
}
.tent {
  display: grid; justify-items: center; gap: 0.9rem; padding: 1.25rem 1.25rem 1.1rem; border-radius: 20px;
  background: var(--paper); text-align: center; box-shadow: 0 1px 0 var(--line), 0 26px 44px -30px rgba(24, 33, 63, .55);
}
.chain-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
.chain-tabs button { min-height: 38px; padding: 0.3em 1em; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-soft); font-weight: 700; font-size: var(--t-sm); cursor: pointer; }
.chain-tabs [aria-selected="true"] { background: var(--ai); border-color: var(--ai); color: #fff; }
.tent-chain { margin: 0; color: var(--ai); font-weight: 700; }
.qr-expired { position: absolute; inset: 0; display: none; place-items: center; background: rgba(255, 255, 255, .86); color: var(--danger); font-weight: 700; font-size: var(--t-xl); }
.charge[data-phase="expired"] .qr-expired { display: grid; }
.tent-hint { max-width: 38ch; margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }
.charge-side { display: grid; gap: 1rem; padding-top: 0.4rem; }
.listen { display: flex; align-items: center; gap: 0.65rem; margin: 0; font-weight: 700; }
.pulse { width: 12px; height: 12px; flex: none; border-radius: 50%; background: #9aa6bd; }
.listen[data-state="ok"] .pulse { background: var(--matcha); animation: pulse 1.8s ease-out infinite; }
.listen[data-state="bad"], .listen[data-state="partial"] { color: var(--danger); }
.listen[data-state="bad"] .pulse, .listen[data-state="partial"] .pulse { background: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 125, 78, .45); } 75%, 100% { box-shadow: 0 0 0 11px rgba(63, 125, 78, 0); } }
.countdown { margin: 0; color: var(--ink-soft); font-family: var(--font-dot); font-size: var(--t-lg); }
.charge[data-phase="expired"] .countdown { color: var(--danger); }
.tool-row { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-left: -0.7rem; }
.txcheck summary { display: flex; align-items: center; min-height: 44px; color: var(--ai); font-weight: 700; cursor: pointer; }
.txcheck-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; }
.field-msg { margin: 0.4rem 0 0; color: var(--ink-soft); font-size: var(--t-xs); }
.field-msg[data-kind="error"] { color: var(--danger); font-weight: 700; }
.others { padding: 0.8rem 0.9rem; border: 1.5px solid var(--ochre-line); border-radius: 12px; background: var(--ochre-wash); }
.others-title { margin: 0 0 0.5rem; color: var(--ochre-ink); font-weight: 700; font-size: var(--t-sm); }
.others-list { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.others-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 0.75rem; }
.o-amt { font-family: var(--font-dot); }
.o-meta { grid-column: 1; color: var(--ink-soft); font-size: var(--t-xs); }
.others-list .btn { grid-column: 2; grid-row: 1 / span 2; }
.charge-foot { display: flex; justify-content: space-between; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.present-exit { display: none; }
#overlay.present .charge-side, #overlay.present .bill-no, #overlay.present .bill-desc, #overlay.present .seg-sm { display: none; }
#overlay.present .charge-stage { grid-template-columns: 1fr; justify-items: center; padding-top: 1.25rem; }
#overlay.present .qr-frame { width: min(68vh, 88vw, 620px); }
#overlay.present .present-exit {
  position: fixed; top: max(0.75rem, env(safe-area-inset-top)); right: 0.75rem; z-index: 2; display: inline-flex;
  background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff;
}

/* paid: the slip gets its stamp */
.paid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start;
  gap: clamp(1.25rem, 3vw, 2.5rem); width: 100%; max-width: 1000px; margin: 0 auto; padding: 2.25rem clamp(1rem, 4vw, 3rem) 2.5rem;
}
.paid-slip { position: relative; padding: 1.6rem 1.5rem 1.5rem; background: var(--paper); text-align: center; box-shadow: 0 16px 36px -26px rgba(24, 33, 63, .6); }
.paid-slip .bill-no { color: var(--ink-soft); opacity: 1; }
.paid-slip .bill-amount { color: var(--ink); font-size: clamp(3rem, 7vw, 4.8rem); }
.paid-stamp { position: absolute; top: 0.7rem; right: 1rem; width: clamp(100px, 12.5vw, 132px); aspect-ratio: 1; }
.paid-title { margin: 1.5rem 0 0.1rem; font-size: var(--t-xl); font-weight: 700; }
.paid-sub { margin: 0; color: var(--ink-soft); }
.paid-flag { display: inline-block; margin: 0.6rem 0 0; padding: 0.25rem 0.75rem; border: 1px solid var(--ochre-line); border-radius: 8px; background: var(--ochre-wash); color: var(--ochre-ink); font-size: var(--t-xs); font-weight: 700; }
.paid-receipt { display: grid; justify-items: center; gap: 0.6rem; padding: 1.25rem; border-radius: 20px; background: var(--paper); text-align: center; }
.paid-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; }
.paid-actions .btn.big { min-width: min(280px, 100%); }
.ended { width: min(560px, 100%); margin: 0 auto; padding: 3rem 1rem; text-align: center; }
.ended .bill-no, .ended .bill-amount { color: var(--ink-soft); opacity: 1; }
.ended-title { margin: 1.5rem 0 0.5rem; font-size: var(--t-xl); }
.ended-text { color: var(--ink-soft); }

/* ---------- sales ---------- */
.sales { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1rem clamp(0.75rem, 2vw, 1.5rem) 2.5rem; }
.sales-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.1rem; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .ic { position: absolute; top: 50%; left: 0.75rem; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.search input { padding-left: 2.5rem; }
.sales-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; gap: 1.5rem; }
.summary { position: sticky; top: 0.5rem; }
.z { position: relative; padding: 1.25rem 1.25rem 1.1rem; background: var(--paper); box-shadow: 0 12px 28px -24px rgba(24, 33, 63, .55); }
.z-range { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 700; }
.z-total { margin: 0.15rem 0 0; font-family: var(--font-dot); font-size: var(--t-3xl); line-height: 1.15; }
.z-count { margin: 0.2rem 0 0.9rem; color: var(--ink-soft); font-size: var(--t-sm); }
.z-rows { display: grid; gap: 0.3rem; margin: 0 0 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); font-size: var(--t-sm); }
.z-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.z-rows dt { color: var(--ink-soft); }
.z-rows dd { margin: 0; text-align: right; font-family: var(--font-dot); }
.z-rows small { color: var(--ink-soft); font-family: var(--font-ui); }
.z-items { padding-top: 0.3rem; border-top: 1px dashed var(--line); font-size: var(--t-sm); }
.z-items summary { display: flex; align-items: center; min-height: 40px; color: var(--ai); font-weight: 700; cursor: pointer; }
.z-items ol { display: grid; gap: 0.25rem; margin: 0 0 0.6rem; padding: 0; list-style: none; }
.z-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto 5.5em; gap: 0.6rem; }
.z-items li span:not(:first-child) { font-family: var(--font-dot); text-align: right; }
.z-note { margin: 0.35rem 0 0; color: var(--ink-soft); font-size: var(--t-xs); }
.z-actions { display: grid; gap: 0.4rem; margin-top: 1rem; }
.z-actions .btn { justify-content: flex-start; }
.day { margin-bottom: 1.4rem; }
.day-head { display: flex; justify-content: space-between; margin: 0 0 0.45rem; padding: 0 0.3rem; color: var(--ink-soft); font-size: var(--t-sm); }
.day-head span:last-child { color: var(--ink); font-family: var(--font-dot); font-weight: 400; }
.rows { margin: 0; padding: 0; overflow: hidden; list-style: none; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; }
.rows li + li { border-top: 1px solid var(--line-soft); }
.row {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto auto 1.5rem; align-items: center; gap: 0.8rem;
  width: 100%; padding: 0.7rem 1rem; border: 0; background: none; text-align: left; cursor: pointer;
}
.row:hover { background: #f5f7fb; }
.row-time { color: var(--ink-soft); font-family: var(--font-dot); }
.row-main { display: grid; min-width: 0; }
.row-desc { overflow: hidden; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.row-no { color: var(--ink-soft); font-size: var(--t-xs); }
.row-amt { font-family: var(--font-dot); font-size: var(--t-lg); text-align: right; }
.row-state { display: grid; place-items: center; color: var(--matcha); }
.mini-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--ochre); }
.row-state[data-state="bad"] .mini-dot { background: var(--danger); }
.unpaid { margin-bottom: 1.4rem; padding: 1rem; border: 1.5px solid var(--ochre-line); border-radius: 14px; background: var(--ochre-wash); }
.unpaid-head { margin: 0; font-size: var(--t-md); }
.unpaid-text { margin: 0.25rem 0 0.8rem; color: var(--ochre-ink); font-size: var(--t-xs); }
.unpaid-list { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.unpaid-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.75rem; padding: 0.55rem 0.5rem 0.55rem 0.9rem; border-radius: 10px; background: var(--paper); }
.unpaid-actions { display: flex; align-items: center; gap: 0.15rem; }
.sale-view { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.5rem; }
.sale-paper { padding: 1rem 1rem 1.7rem; border-radius: 12px; background: var(--mist); }
.sale-paper .receipt { position: relative; }
.sale-side { display: grid; align-content: start; gap: 0.7rem; padding-top: 2.2rem; }
.sale-status { margin: 0; font-weight: 700; }
.sale-status[data-state="ok"] { color: var(--matcha); }
.sale-status[data-state="wait"] { color: var(--ochre); }
.sale-status[data-state="bad"] { color: var(--danger); }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 720px); justify-content: center; gap: 2rem; padding: 1.25rem clamp(0.75rem, 2vw, 1.5rem) 7rem; }
.set-nav { position: sticky; top: 1rem; align-self: start; display: grid; gap: 0.1rem; }
.set-nav a { padding: 0.55rem 0.8rem; border-radius: 8px; color: var(--ink-soft); font-weight: 700; font-size: var(--t-sm); text-decoration: none; }
.set-nav a:hover { background: var(--ai-wash); color: var(--ai); }
.set-sec { margin-bottom: 1.25rem; padding: 1.35rem 1.35rem 0.6rem; border-radius: var(--r-card); background: var(--paper); scroll-margin-top: 1rem; }
.set-sec > h2 { margin: 0 0 1.1rem; font-size: var(--t-lg); }
.set-sec > p { max-width: 64ch; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.field.narrow { max-width: 240px; }
.chain-grid { display: grid; }
.chain-opt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--line); }
.chain-test { color: var(--ink-soft); font-size: var(--t-xs); font-weight: 400; }
.radio-inline { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; color: var(--ink-soft); font-size: var(--t-sm); cursor: pointer; }
.prod-head, .prod-row { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.2fr) 124px; align-items: center; gap: 0.45rem; }
.prod-head { padding: 0 0.1rem 0.35rem; color: var(--ink-soft); font-size: var(--t-xs); font-weight: 700; }
.prod-list { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.prod-row.invalid input { border-color: var(--danger); }
.p-tools { display: flex; }
.prod-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 1.1rem; }
.nodes summary { display: flex; align-items: center; min-height: 44px; margin-bottom: 0.5rem; color: var(--ai); font-weight: 700; cursor: pointer; }
.node-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 0.5rem; }
.node-row .field { margin-bottom: 0.25rem; }
.node-row .btn { margin-bottom: 0.25rem; }
.node-result { grid-column: 1 / -1; min-height: 1.2em; margin: 0 0 0.8rem; color: var(--ink-soft); font-size: var(--t-xs); }
.node-result[data-kind="ok"] { color: var(--matcha); font-weight: 700; }
.node-result[data-kind="error"] { color: var(--danger); font-weight: 700; }
.relay-result { overflow-wrap: anywhere; font-size: var(--t-sm); }
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem;
  padding: 0.75rem clamp(0.75rem, 2vw, 1.5rem) calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(24, 33, 63, .45);
  transform: translateY(110%); transition: transform .2s ease;
}
.save-bar[data-dirty="true"] { transform: none; }
.save-note { margin-right: auto; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 700; }

/* ---------- first run ---------- */
.setup { display: grid; justify-items: center; padding: 2rem 1rem 3.5rem; }
.setup-card { position: relative; width: min(580px, 100%); padding: 2rem clamp(1.25rem, 4vw, 2.4rem) 1.75rem; background: var(--paper); box-shadow: 0 18px 40px -30px rgba(24, 33, 63, .6); }
.setup-title { margin: 0; font-size: var(--t-2xl); }
.setup-lead { margin: 0.4rem 0 1.6rem; color: var(--ink-soft); }
.setup-steps { margin: 0 0 0.5rem; padding: 0; list-style: none; counter-reset: step; }
.setup-steps > li { position: relative; padding-left: 2.6rem; counter-increment: step; }
.setup-steps > li::before {
  content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 1.85rem; height: 1.85rem;
  border: 1.5px solid var(--ai); border-radius: 50%; color: var(--ai); font-family: var(--font-dot); font-size: var(--t-sm);
}
.chip-checks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.setup-go { width: 100%; margin-top: 0.75rem; }
.setup-safe { display: flex; align-items: flex-start; gap: 0.5rem; margin: 1rem 0 0; color: var(--ink-soft); font-size: var(--t-xs); }
.setup-safe .ic { width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .sales-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .settings { grid-template-columns: 1fr; gap: 0.75rem; }
  .set-nav { position: static; display: flex; gap: 0.3rem; overflow-x: auto; scrollbar-width: none; }
  .set-nav a { white-space: nowrap; background: var(--paper); }
  .charge-stage, .paid { grid-template-columns: 1fr; }
  .charge-stage { justify-items: center; }
  .charge-side { width: min(100%, 520px); }
}

@media (max-width: 760px) {
  .register { display: block; height: auto; min-height: 100%; padding: 0.75rem 0.75rem calc(96px + env(safe-area-inset-bottom)); }
  .pick-body { overflow: visible; padding: 12px 2px 0; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
  .tile { min-height: 96px; }
  .tape-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem;
    padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -16px rgba(24, 33, 63, .4);
  }
  .bar-sum { display: flex; align-items: center; gap: 0.6rem; min-height: 54px; padding: 0 0.85rem; border: 0; border-radius: 10px; background: var(--ai-wash); color: var(--ink); cursor: pointer; }
  .bar-sum:disabled { opacity: .6; cursor: default; }
  .bar-count { color: var(--ink-soft); font-size: var(--t-xs); white-space: nowrap; }
  .bar-amt { margin-left: auto; font-family: var(--font-dot); font-size: var(--t-xl); }
  .tape-bar .charge-btn { min-height: 54px; padding-inline: 1.3em; font-size: var(--t-md); }
  .sheet-scrim { position: fixed; inset: 0; z-index: 29; display: block; background: rgba(24, 33, 63, .42); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .tape-col {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 88dvh;
    padding: 0.4rem 0.75rem calc(0.9rem + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0;
    background: var(--mist); box-shadow: 0 -12px 40px rgba(24, 33, 63, .3);
    transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .28s;
  }
  .register[data-sheet="open"] .tape-col { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s; }
  .register[data-sheet="open"] .sheet-scrim { opacity: 1; pointer-events: auto; }
  .tape-col::before { display: none; }
  .sheet-handle { display: flex; justify-content: center; padding: 0.3rem 0 0.7rem; cursor: pointer; }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 3px; background: #aeb6c7; }
  .tape { min-height: 0; margin: 0; }
}

@media (max-width: 640px) {
  .noren { gap: 0.5rem; }
  .brand-name { font-size: var(--t-md); }
  .tab { flex-direction: column; gap: 0; padding: 0.2rem 0.5rem; font-size: 0.68rem; }
  .net-label { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .prod-head { display: none; }
  .prod-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.6rem; border: 1px solid var(--line-soft); border-radius: 10px; }
  .prod-row .p-name, .prod-row .p-tools { grid-column: 1 / -1; }
  .prod-row .p-tools { justify-content: flex-end; }
  .row { grid-template-columns: 3rem minmax(0, 1fr) auto 1.2rem; gap: 0.6rem; padding: 0.65rem 0.75rem; }
  .row-chain { display: none; }
  .unpaid-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .unpaid-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .sale-view { grid-template-columns: 1fr; }
  .sale-side { padding-top: 0; }
  .charge-bill { padding-bottom: 1.5rem; }
  .tent { padding: 1rem; }
}

/* owner confirmation and the store's gas wallet */
.owner-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: -0.35rem 0 1.15rem; padding: 0.7rem 0.9rem; border: 1.5px solid var(--ochre-line); border-radius: 10px; background: var(--ochre-wash); font-size: var(--t-sm); }
.owner-box[data-ok="true"] { border-color: #b9d7c2; background: #e7f2ea; color: #23502f; }
.owner-box p { display: flex; align-items: flex-start; gap: 0.5rem; flex: 1 1 260px; margin: 0; }
.owner-box .ic { margin-top: 0.15rem; }
.owner-wallet { margin: 0 0 0.5rem; font-size: var(--t-sm); }
.owner-sign .owner-local { width: 100%; margin: 0.4rem 0 1rem; }
.owner-qr { display: grid; justify-items: center; gap: 0.4rem; padding: 1rem; border-radius: 12px; background: var(--mist); text-align: center; }
.setup-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: -0.5rem 0 1.1rem; }
.setup-owner[data-ok="true"] .hint { color: var(--matcha); font-weight: 700; }
.gas-wallet { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: start; gap: 1.25rem; margin-bottom: 0.5rem; }
.gas-qr { width: 150px; }
.gas-info .kv { margin-top: 0; }
.gas-info .kv dd { display: flex; align-items: center; justify-content: flex-end; gap: 0.2rem; }
.gas-status { margin: 0.8rem 0 0.3rem; font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); }
.gas-status[data-st="on"] { color: var(--matcha); }
.gas-status[data-st="low"], .gas-status[data-st="owner"] { color: var(--ochre); }
code.addr { font-family: var(--font-ui); font-size: var(--t-xs); word-break: break-all; }
code.key { display: block; padding: 0.75rem; border-radius: 8px; background: var(--mist); font-size: var(--t-sm); user-select: all; }
.relay-line { margin: 0; color: var(--matcha); font-size: var(--t-sm); font-weight: 700; }
.relay-line[data-st="error"] { color: var(--danger); }
@media (max-width: 640px) {
  .gas-wallet { grid-template-columns: 1fr; }
  .gas-qr { justify-self: center; width: 180px; }
}

/* connections (RPC) */
.rpc-status { display: grid; gap: 0.4rem; margin: 0.5rem 0; }
.rpc-chain { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rpc-chain > summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; cursor: pointer; font-size: var(--t-sm); }
.rpc-chain .rpc-sum { color: var(--ink-soft); }
.rpc-chain .dot, .rpc-eps .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.rpc-chain[data-st="ok"] > summary .dot, .rpc-eps [data-st="ok"] .dot { background: var(--matcha); }
.rpc-chain[data-st="thin"] > summary .dot, .rpc-eps [data-st="limit"] .dot, .rpc-eps [data-st="stale"] .dot { background: var(--ochre); }
.rpc-chain[data-st="bad"] > summary .dot, .rpc-eps [data-st="down"] .dot, .rpc-eps [data-st="denied"] .dot { background: var(--danger); }
.rpc-eps { list-style: none; margin: 0; padding: 0 0.8rem 0.6rem 1.9rem; display: grid; gap: 0.25rem; font-size: var(--t-xs); }
.rpc-eps li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rpc-eps code, .rpc-mine code { font-family: var(--font-ui); word-break: break-all; }
.rpc-eps small { margin-left: auto; color: var(--ink-soft); }
.rpc-eps em { font-style: normal; font-weight: 700; color: var(--ai); }
.rpc-own { margin-top: 0.75rem; }
.rpc-own > summary { cursor: pointer; font-weight: 700; padding: 0.4rem 0; }
.rpc-steps { margin: 0.5rem 0 0.75rem; padding-left: 1.3rem; display: grid; gap: 0.6rem; font-size: var(--t-sm); }
.rpc-steps .seg { margin-top: 0.4rem; flex-wrap: wrap; }
.rpc-note a { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.4rem; font-weight: 700; color: var(--ai); }
.rpc-add-row { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.rpc-add-row input { flex: 1; min-width: 0; }
.field-msg[data-kind="ok"] { color: var(--matcha); font-weight: 700; }
.rpc-mine { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.3rem; font-size: var(--t-xs); }
.rpc-mine li { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.4rem 0.6rem; border-radius: 8px; background: var(--mist); }
.rpc-mine button { margin-left: auto; }
.o-warn { display: block; color: var(--danger); font-weight: 700; }
.owner-strip { margin: 0; padding: 0.35rem 1rem; background: var(--ochre-wash); border-bottom: 1px solid var(--ochre-line); font-size: var(--t-sm); text-align: center; }
.owner-strip[data-st="invalid"] { background: var(--danger); border-color: var(--danger); }
.owner-strip a { color: var(--ochre-ink); font-weight: 700; }
.owner-strip[data-st="invalid"] a { color: #fff; }

/* ---------- guided setup (かんたん設定) ---------- */
.ob { max-width: 1060px; margin: 0 auto; padding: 1rem clamp(0.75rem, 3vw, 2rem) 7rem; }
.ob-top { display: flex; align-items: center; gap: 0.75rem; padding: 0.2rem 0 0.7rem; }
.ob-brand { margin: 0; display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--ai); }
.ob-brand .ic { width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: var(--ai); color: #fff; }
.ob-count { margin: 0 0 0 auto; font-size: var(--t-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ob-later { border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0.4rem 0.2rem; }
.ob-later:hover { color: var(--ink); }
.ob-progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ai) 12%, transparent); overflow: hidden; }
.ob-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ai), color-mix(in srgb, var(--ai) 55%, var(--matcha))); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.ob-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 1.5rem; margin-top: 1.25rem; align-items: start; }
.ob[data-step="welcome"] .ob-body, .ob[data-step="done"] .ob-body, .ob[data-step="restore"] .ob-body { grid-template-columns: minmax(0, 1fr); }
.ob[data-step="welcome"] .ob-rail, .ob[data-step="done"] .ob-rail, .ob[data-step="restore"] .ob-rail { display: none; }
.ob[data-step="welcome"] .ob-stage, .ob[data-step="done"] .ob-stage, .ob[data-step="restore"] .ob-stage { max-width: 760px; width: 100%; margin: 0 auto; }
.ob[data-step="restore"] .ob-progress { visibility: hidden; }
.ob-rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; position: sticky; top: 0.75rem; }
.ob-rail li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: 10px; font-size: var(--t-sm); color: var(--ink-soft); transition: background .3s, color .3s, box-shadow .3s; }
.ob-rail .ob-dot { flex: none; position: relative; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 0.8rem; transition: background .3s, border-color .3s, color .3s; }
.ob-rail .ob-rname { flex: 1; }
.ob-rail li[data-state="current"] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 8px 20px -16px rgba(24, 33, 63, .7); }
.ob-rail li[data-state="current"] .ob-dot { border-color: var(--ai); background: var(--ai); color: #fff; }
.ob-rail li[data-state="done"] { color: var(--ink); }
.ob-rail li[data-state="done"] .ob-dot { border-color: var(--matcha); background: var(--matcha); color: transparent; }
.ob-rail li[data-state="done"] .ob-dot::after { content: ''; position: absolute; left: 7px; top: 7px; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg); animation: obPop .35s ease-out; }
.ob-rail li[data-state="skipped"] .ob-dot { border-style: dashed; }
.ob-badge { flex: none; display: inline-block; padding: 0.08rem 0.5rem; border-radius: 99px; font-size: 0.72rem; font-weight: 700; line-height: 1.55; letter-spacing: 0.02em; }
.ob-badge[data-k="req"] { background: color-mix(in srgb, var(--danger) 11%, #fff); color: var(--danger); }
.ob-badge[data-k="rec"] { background: color-mix(in srgb, var(--ochre) 20%, #fff); color: var(--ochre-ink); }
.ob-badge[data-k="opt"] { background: var(--mist); color: var(--ink-soft); border: 1px solid var(--line); }
.ob-stage { min-width: 0; }
.ob-card { background: var(--paper); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2.25rem); box-shadow: 0 26px 50px -38px rgba(24, 33, 63, .6), 0 1px 0 rgba(24, 33, 63, .05); }
.ob-card.ob-in { animation: obIn .42s cubic-bezier(.2,.8,.2,1) both; }
.ob-card.ob-in-back { animation: obInBack .42s cubic-bezier(.2,.8,.2,1) both; }
.ob-card.ob-out { animation: obOut .15s ease-in both; }
.ob-card.ob-out-back { animation: obOutBack .15s ease-in both; }
@keyframes obIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes obInBack { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes obOut { to { opacity: 0; transform: translateX(-16px); } }
@keyframes obOutBack { to { opacity: 0; transform: translateX(16px); } }
@keyframes obPop { from { transform: rotate(-45deg) scale(0); } to { transform: rotate(-45deg) scale(1); } }
@keyframes obUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes obFloat { 50% { transform: translateY(-6px); } }
@keyframes obDraw { to { stroke-dashoffset: 0; } }
.ob-kicker { margin: 0 0 0.55rem; }
.ob-title { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.95rem); line-height: 1.3; }
.ob-lead { margin: 0.55rem 0 1.4rem; color: var(--ink-soft); line-height: 1.8; max-width: 44em; }
.ob-card .field { margin-bottom: 1rem; }
.ob-card .field input:not([type=radio]):not([type=checkbox]), .ob-card select { font-size: 1.05rem; }
.ob-note { display: flex; gap: 0.5rem; align-items: flex-start; margin: 1rem 0 0; padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--mist); font-size: var(--t-sm); line-height: 1.65; }
.ob-note.warn { background: var(--ochre-wash); border: 1px solid var(--ochre-line); }
.ob-note .ic { flex: none; width: 18px; height: 18px; margin-top: 0.15rem; }
.ob-okline { display: flex; align-items: center; gap: 0.65rem; margin: 0.25rem 0 0; padding: 0.95rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--matcha) 13%, #fff); font-weight: 700; animation: obUp .4s ease-out both; }
.ob-okline .ic { flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--matcha); color: #fff; }
.ob-ownerbox { display: grid; justify-items: start; gap: 0.5rem; }
.ob-hero { text-align: center; padding: 0.25rem 0 0.2rem; }
.ob-mark { width: 84px; height: 84px; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 24px; background: var(--ai); color: #fff; box-shadow: 0 18px 30px -18px var(--ai); animation: obFloat 4.5s ease-in-out infinite; }
.ob-mark .ic { width: 44px; height: 44px; }
.ob-hero .ob-lead { margin-inline: auto; }
.ob-list { list-style: none; margin: 0 auto 1.25rem; padding: 0; max-width: 600px; display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.8rem; }
.ob-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 10px; background: var(--mist); font-size: var(--t-sm); animation: obUp .45s calc(var(--i) * 55ms + 150ms) cubic-bezier(.2,.8,.2,1) both; }
.ob-list .ob-lname { flex: 1; font-weight: 700; }
.ob-num { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 0.75rem; font-weight: 700; color: var(--ai); }
.ob-need { max-width: 600px; margin: 0 auto; padding: 0.9rem 1rem; border: 1px dashed var(--line); border-radius: 12px; font-size: var(--t-sm); }
.ob-need p { margin: 0 0 0.45rem; }
.ob-need ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.ob-need li { display: flex; gap: 0.5rem; align-items: flex-start; line-height: 1.6; }
.ob-need .ic { flex: none; width: 18px; height: 18px; margin-top: 0.15rem; color: var(--ai); }
.ob-safe { display: flex; justify-content: center; align-items: center; gap: 0.4rem; margin: 1rem 0 0; font-size: var(--t-xs); color: var(--ink-soft); }
.ob-safe .ic { width: 16px; height: 16px; flex: none; }
.ob-addr:empty { display: none; }
.ob-addr-card { margin-top: 0.5rem; padding: 0.9rem 1rem; border-radius: 12px; background: #fff; border: 1.5px solid var(--matcha); animation: obUp .35s ease-out both; }
.ob-addr-label { display: flex; align-items: center; gap: 0.35rem; font-size: var(--t-xs); font-weight: 700; color: var(--matcha); margin-bottom: 0.35rem; }
.ob-addr-label .ic { width: 16px; height: 16px; }
.ob-addr-card code { display: block; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: clamp(0.95rem, 2.1vw, 1.2rem); letter-spacing: 0.03em; word-spacing: 0.3em; line-height: 1.65; word-break: break-all; }
.ob-addr-card code b { color: var(--ai); background: color-mix(in srgb, var(--ai) 10%, transparent); padding: 0 0.15em; border-radius: 4px; }
.ob-addr-card small { display: block; margin-top: 0.35rem; color: var(--ink-soft); line-height: 1.6; }
.ob-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.7rem; margin-bottom: 1.1rem; }
.ob-choice { position: relative; display: flex; gap: 0.75rem; align-items: flex-start; padding: 1rem; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.ob-choice:hover { transform: translateY(-1px); }
.ob-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ob-choice-mark { flex: none; width: 20px; height: 20px; margin-top: 0.15rem; border-radius: 50%; border: 2px solid var(--line); transition: border-color .2s, background .2s; }
.ob-choice-body { display: grid; gap: 0.25rem; }
.ob-choice-body b em { font-style: normal; margin-left: 0.45rem; padding: 0.05rem 0.45rem; border-radius: 99px; background: var(--ai); color: #fff; font-size: 0.7rem; vertical-align: 2px; }
.ob-choice-body small { color: var(--ink-soft); line-height: 1.6; }
.ob-choice:has(input:checked) { border-color: var(--ai); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ai) 14%, transparent); }
.ob-choice:has(input:checked) .ob-choice-mark { border-color: var(--ai); background: radial-gradient(circle, var(--ai) 42%, #fff 47%); }
.ob-choice:has(input:focus-visible) { outline: 2px solid var(--ai); outline-offset: 2px; }
.ob-own { margin-top: 0.25rem; animation: obUp .3s ease-out both; }
.ob-prows { display: grid; gap: 0.5rem; margin-bottom: 0.5rem; }
.ob-prow { display: grid; grid-template-columns: minmax(0, 1fr) 140px 90px; gap: 0.5rem; }
.ob-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.ob-gas { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ob-gas .qr-frame { width: 180px; }
.ob-gas-label { margin: 0 0 0.2rem; font-weight: 700; font-size: var(--t-sm); }
.ob-gas-addr { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; word-break: break-all; margin-bottom: 0.6rem; }
.ob-gas-text { margin: 0 0 0.5rem; line-height: 1.65; font-size: var(--t-sm); }
.ob-gas-bal { font-weight: 700; margin: 0 0 0.5rem; }
.ob-gas-bal[data-ok="true"] { color: var(--matcha); }
.ob-done { text-align: center; }
.ob-seal { width: 108px; height: 108px; margin: 0 auto 0.8rem; }
.ob-seal svg { width: 100%; height: 100%; overflow: visible; }
.ob-seal-ring { fill: color-mix(in srgb, var(--matcha) 13%, #fff); stroke: var(--matcha); stroke-width: 5; stroke-dasharray: 330; stroke-dashoffset: 330; animation: obDraw .75s .1s cubic-bezier(.6,0,.2,1) forwards; }
.ob-seal-check { fill: none; stroke: var(--matcha); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: obDraw .45s .75s cubic-bezier(.6,0,.2,1) forwards; }
.ob-done .ob-lead { margin-inline: auto; }
.ob-summary { list-style: none; margin: 0 auto 1.1rem; padding: 0; max-width: 600px; display: grid; gap: 0.35rem; }
.ob-summary li { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.8rem; border-radius: 10px; background: var(--mist); font-size: var(--t-sm); animation: obUp .4s calc(var(--i) * 70ms + 550ms) ease-out both; }
.ob-sname { flex: 1; font-weight: 700; }
.ob-sdot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line); }
.ob-sdot .ic { width: 15px; height: 15px; }
.ob-summary li[data-st="done"] .ob-sdot { border: 0; background: var(--matcha); color: #fff; }
.ob-summary li[data-st="warn"] { background: var(--ochre-wash); }
.ob-summary li[data-st="warn"] .ob-sdot { border: 0; background: var(--ochre); }
.ob-summary li[data-st="warn"] small { color: var(--ochre-ink); font-weight: 700; }
.ob-summary small { color: var(--ink-soft); }
.ob-tip { max-width: 600px; margin: 0 auto; padding: 1rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ai) 25%, transparent); background: color-mix(in srgb, var(--ai) 5%, #fff); font-size: var(--t-sm); }
.ob-tip p { margin: 0 0 0.5rem; line-height: 1.65; }
.ob-help { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 0.9rem; margin: 1rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }
.ob-help a { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ai); font-weight: 700; }
.ob-help .ic { width: 16px; height: 16px; }
.ob-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem max(1rem, calc((100vw - 1060px) / 2 + 2rem)); padding-bottom: calc(0.8rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, #fff 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.ob-actions .grow { flex: 1; }
.ob-actions .btn.big { min-width: 12rem; }
.ic.flip { transform: scaleX(-1); }
.ob-warn { text-align: center; }
.ob-warn-icon { width: 54px; height: 54px; margin: 0 auto 0.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--ochre-wash); color: var(--ochre-ink); font-weight: 900; font-size: 1.6rem; border: 2px solid var(--ochre); }
.ob-warn-list { text-align: left; margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; font-size: var(--t-sm); line-height: 1.75; }
.ob-warn-strong { font-weight: 700; margin: 0 0 1rem; }
.ob-warn-actions { display: grid; gap: 0.5rem; }
.ob-reopen { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem; margin: 0 0 1.25rem; padding: 0.8rem 0.9rem; border-radius: 12px; background: color-mix(in srgb, var(--ai) 6%, #fff); }
.ob-reopen[data-manual] { border: 1.5px solid var(--ai); }
.ob-reopen small { color: var(--ink-soft); line-height: 1.6; }
@media (max-width: 780px) {
  .ob-body { grid-template-columns: minmax(0, 1fr); }
  .ob-rail { display: none; }
  .ob-list, .ob-two, .ob-gas { grid-template-columns: minmax(0, 1fr); }
  .ob-prow { grid-template-columns: minmax(0, 1fr) 96px 74px; }
  .ob-actions .btn.big { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ob *, .ob-card { animation: none !important; transition: none !important; }
  .ob-seal-ring, .ob-seal-check { stroke-dashoffset: 0; }
}
/* smooth page change from the landing page (browsers that support it) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
.ob-agree { margin: 0.5rem 0 0; text-align: center; font-size: var(--t-xs); color: var(--ink-soft); }
.ob-agree a { color: var(--ai); font-weight: 700; }

/* ---- store branding ---- */
.charge-bill { background: var(--brand, var(--ai)); }
.bill-store, .slip-store { display: flex; align-items: center; justify-content: center; gap: 0.55rem; margin: 0 0 0.35rem; font-weight: 700; letter-spacing: 0.03em; }
.bill-store img { width: 36px; height: 36px; border-radius: 10px; background: #fff; object-fit: contain; padding: 2px; }
.slip-store { color: var(--brand, var(--ai)); }
.slip-store img { width: 46px; height: 46px; object-fit: contain; }
.sec-lead { margin: -0.25rem 0 1rem; color: var(--ink-soft); line-height: 1.75; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.logo-pick { display: flex; gap: 1rem; align-items: flex-start; }
.logo-tile { flex: none; width: 96px; height: 96px; border-radius: 20px; border: 1.5px dashed var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.logo-empty .ic { width: 32px; height: 32px; color: var(--ink-soft); }
.logo-actions { display: grid; gap: 0.35rem; min-width: 0; }
.logo-actions .btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 0.2rem 0; }
.swatch { position: relative; display: block; cursor: pointer; }
.swatch input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.sw { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); transition: transform .15s, box-shadow .15s; }
.swatch input:checked + .sw { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); transform: scale(1.05); }
.swatch input:focus-visible + .sw { outline: 2px solid var(--ai); outline-offset: 5px; }
.sw-custom { position: relative; background: conic-gradient(#e0533d, #f2b33a, #3f7d4e, #1e5fa8, #6b4aa8, #e0533d); }
.sw-custom::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; }
.swatch .color-pick { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.brand-preview { --bp: var(--ai); position: sticky; top: 1rem; padding: 0.9rem; border-radius: 16px; background: var(--mist); }
.bp-label { margin: 0 0 0.6rem; font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); }
.bp-phone { overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 10px 24px -18px rgba(24, 33, 63, .7); }
.bp-top { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: var(--bp); color: #fff; font-size: 0.9rem; transition: background .25s; }
.bp-logo { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; overflow: hidden; border-radius: 7px; background: #fff; }
.bp-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.bp-bill { display: grid; padding: 0.75rem; text-align: center; }
.bp-bill small { color: var(--ink-soft); }
.bp-bill b { font-size: 1.6rem; }
.bp-receipt { display: grid; justify-items: center; gap: 0.3rem; margin-top: 0.75rem; padding: 0.9rem 0.75rem; border-radius: 6px; border-top: 3px solid var(--bp); background: #fffdf8; text-align: center; }
.bp-logo-lg { width: 48px; height: 48px; border-radius: 0; background: none; }
.bp-store { color: var(--bp); }
.bp-msg { color: var(--ink-soft); }
.bp-link { padding: 0.15rem 0.6rem; border: 1px solid currentColor; border-radius: 99px; color: var(--bp); font-size: var(--t-xs); font-weight: 700; }
.bp-logo[hidden], .bp-msg[hidden], .bp-link[hidden] { display: none; }
.brand-sync { margin: 0.5rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }
.brand-sync:empty { display: none; }
.ob-card .brand-grid { margin-top: 0.25rem; }
@media (max-width: 860px) { .brand-grid { grid-template-columns: minmax(0, 1fr); } .brand-preview { position: static; } }
.logo-note { color: var(--ok, #2f7d4f); }
.logo-note:empty { display: none; }

/* ---- このお店の情報 ---- */
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.info-preview { position: sticky; top: 1rem; padding: 0.9rem; border-radius: 16px; background: var(--mist); }
.link-list { display: grid; gap: 0.45rem; }
.ev-row { gap: 0.75rem; }
.label.sub { color: var(--ink-soft); font-size: var(--t-xs); font-weight: 400; }
.info-box { margin-top: 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; }
.info-box h3 { margin: 0 0 0.75rem; font-size: var(--t-md); }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem; }
.share-qr { width: 132px; flex: none; }
.share-actions { display: grid; flex: 1 1 260px; gap: 0.5rem; min-width: 0; }
.id-list dd { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; min-width: 0; }
.id-acts { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.bill-store-event { margin: 0 0 0.35rem; font-size: var(--t-sm); font-weight: 700; opacity: 0.92; }
.slip-store-event { margin: -0.15rem 0 0.4rem; color: var(--brand, var(--ai)); font-size: var(--t-sm); font-weight: 700; }
@media (max-width: 860px) { .info-grid { grid-template-columns: minmax(0, 1fr); } .info-preview { position: static; } }

/* ---- 応援 (tips) box ---- */
.tip-box h3 { display: flex; align-items: center; gap: 0.4rem; }
.tip-box h3 .ic { width: 20px; height: 20px; color: var(--ai); }
.tip-state { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.6rem; color: #1f7a4d; font-weight: 700; }
.tip-state .ic { width: 18px; height: 18px; flex: none; }

/* Japanese line breaks: split the charge label at its space (「¥1,300」/「を請求」), never inside 請求; keep the short tab labels on one line */
.charge-btn { word-break: keep-all; overflow-wrap: anywhere; }
.tab { white-space: nowrap; }

/* ---- first screen: new store, or move one from another device ---- */
.ob-choices { display: grid; gap: 0.75rem; max-width: 600px; margin: 0.4rem auto 0.6rem; }
.ob-choice { display: flex; align-items: center; gap: 0.9rem; width: 100%; padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ob-choice:hover, .ob-choice:focus-visible { border-color: var(--ai); box-shadow: 0 10px 24px -18px rgba(24, 33, 63, .7); }
.ob-choice:first-child { border-color: var(--ai); background: color-mix(in srgb, var(--ai) 5%, #fff); }
.ob-choice-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--ai); color: #fff; }
.ob-choice-icon .ic { width: 22px; height: 22px; }
.ob-choice:nth-child(2) .ob-choice-icon { background: var(--mist); color: var(--ai); }
.ob-choice-text { display: grid; gap: 0.2rem; flex: 1 1 auto; min-width: 0; }
.ob-choice-text b { font-size: var(--t-md); }
.ob-choice-text small { color: var(--ink-soft); line-height: 1.6; }
.ob-choice > .ic { flex: none; width: 18px; height: 18px; color: var(--ink-soft); }
.ob-help { max-width: 600px; margin: 0 auto 1.4rem; text-align: center; font-size: var(--t-sm); }
.ob-help a, .rs-guide { display: inline-flex; align-items: center; gap: 0.3rem; }
.ob-help .ic, .rs-guide .ic { width: 15px; height: 15px; }
.ob-sub { max-width: 600px; margin: 0 auto 0.6rem; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 700; }
/* restore panel */
.rs-steps { margin: 0.5rem 0 1rem; padding-left: 1.3rem; line-height: 1.8; }
.rs-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; margin-bottom: 1rem; }
.rs-guide { font-size: var(--t-sm); }
.rs-preview { display: flex; align-items: center; gap: 0.9rem; margin: 0.4rem 0 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; }
.rs-logo { width: 56px; height: 56px; flex: none; padding: 4px; border: 1px solid var(--line-soft); border-radius: 12px; background: #fff; object-fit: contain; }
.rs-mono { display: grid; place-items: center; border: 0; background: var(--ai); color: #fff; font-size: 1.4rem; font-weight: 700; }
.rs-info { min-width: 0; }
.rs-name { margin: 0; font-size: var(--t-lg); font-weight: 700; overflow-wrap: anywhere; }
.rs-meta { margin: 0.15rem 0 0; color: var(--ink-soft); font-size: var(--t-sm); }
.rs-how { display: grid; gap: 0.55rem; margin: 0 0 0.8rem; padding: 0; border: 0; }
.rs-how legend { margin-bottom: 0.4rem; font-weight: 700; }
.rs-opt { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.8rem 0.9rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.rs-opt:has(input:checked) { border-color: var(--ai); background: color-mix(in srgb, var(--ai) 5%, #fff); }
.rs-opt input { margin-top: 0.3rem; accent-color: var(--ai); }
.rs-opt span { display: grid; gap: 0.15rem; }
.rs-opt small { color: var(--ink-soft); line-height: 1.6; }
.help-link a { font-weight: 700; }
/* Japanese titles: break at phrase boundaries (Chrome) and never leave one character alone on a line */
.ob-choice-text b, .ob-title, .rs-name { text-wrap: balance; word-break: auto-phrase; }
.ob-choice-text small, .ob-lead { word-break: auto-phrase; }
@media (max-width: 380px) {
  .ob-choice { gap: 0.7rem; padding: 0.85rem 0.9rem; }
  .ob-choice > .ic { display: none; }
  .ob-choice-icon { width: 38px; height: 38px; }
}

/* the hint under the QR: break at phrases, never leave one character alone (「…ください／い」) */
.tent-hint { text-wrap: balance; word-break: auto-phrase; }
