/* Register: order entry + checkout. Tokens, .btn and keyframes come from staff.css. */

.rg {
  height: 100%; min-height: 600px;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 32vw, 390px); grid-template-rows: minmax(0, 1fr); gap: 24px;
  padding: 20px var(--pad) 24px;
}
.rg-panel {
  min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px;
  background: var(--white); border: var(--border); border-radius: 26px; box-shadow: var(--shadow-lg);
}
.rg-head { display: flex; align-items: center; gap: 10px; }
.rg-no { font-size: 64px; line-height: .95; }
.rg-head__t { font-size: 14px; font-weight: 900; }
.rg-head .btn { margin-left: auto; min-height: 44px; }
.rg-sum__r { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.rg-sum__r b { font-size: 14px; }
.rg-sum__r--off b { background: var(--hot); padding: 1px 8px; border-radius: 6px; } /* pink = Instagram / combo */
.rg-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 900; }
.rg-total .num { font-size: 52px; line-height: 1; transform-origin: right center; }
.rg-total .num.is-bumped { animation: rg-tick .32s var(--ease-spring); }
@keyframes rg-tick { 40% { transform: scale(1.08); } }
.rg-fade { animation: fade-in .25s var(--ease-out); }

/* ---------- order screen: menu ---------- */
.rg-menu { min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 0 5px 5px 0; }
.rg-sec { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.rg-sec--burger { flex: 4 1 120px; }
.rg-mid { flex: 3.4 1 110px; min-height: 0; display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.rg-sec--drink { flex: 1.5 1 74px; }
.rg-h { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 700; }
.rg-h .en { font-size: 14px; }
.rg-mid:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); } /* an owner hid every twister (or every side) */
.rg-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.rg-foot { margin: 0; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; font-weight: 500; opacity: .75; }
.rg-foot__hint { flex: none; font-weight: 700; }

.rg-tile {
  position: relative; min-width: 0; min-height: 0; padding: 12px 10px; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--c); color: var(--ink); border: var(--border); border-radius: 16px; box-shadow: var(--shadow);
  -webkit-touch-callout: none; -webkit-appearance: none; appearance: none;
  transition: transform .09s var(--ease-out), box-shadow .09s var(--ease-out), background-color .2s, color .2s, border-color .2s;
}
.rg-tile__name { font-size: var(--name, clamp(14px, 1.5vw, 19px)); line-height: 1.04; letter-spacing: -.01em; }
.rg-tile__jp { font-size: clamp(10px, .9vw, 12px); font-weight: 500; line-height: 1.3; }
.rg-tile__price { margin-top: auto; font-size: clamp(14px, 1.5vw, 19px); }
.rg-tile--drink { padding: 8px 10px; }
.rg-tile--drink .rg-tile__name { font-size: var(--name, clamp(11px, 1.1vw, 14px)); }
.rg-tile--drink .rg-tile__jp { font-size: clamp(9px, .8vw, 10.5px); }
.rg-tile--drink .rg-tile__price { font-size: clamp(12px, 1.1vw, 14px); }
.rg-tile:active, .rg-tile.is-pressed { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.rg-tile.is-shake { animation: shake .35s; }

/* long-press cue: the tile sinks a bit more and fills from the bottom over the 600 ms */
.rg-tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: rgb(27 15 12 / .22); clip-path: inset(100% 0 0 0);
}
.rg-tile.is-holding { transform: translate(3px, 3px) scale(.97); box-shadow: 1px 1px 0 var(--ink); }
.rg-tile.is-holding::after { animation: rg-fill .45s .15s linear forwards; }
@keyframes rg-fill { to { clip-path: inset(0 0 0 0); } }

.rg-badge {
  position: absolute; top: -11px; right: -9px; min-width: 34px; height: 34px; padding: 0 7px;
  display: grid; place-items: center; border: var(--border); border-radius: 999px;
  background: var(--ink); color: var(--pec); font-family: var(--font-label); font-weight: 900; font-size: 17px; /* not red: red is kept for destructive buttons */
  animation: pop-in .35s var(--ease-spring); pointer-events: none;
}
.rg-badge.is-bumped { animation: bump .35s var(--ease-spring); }

/* sold out (tilted stamp) / not sold in snack time (small label): greyed and not addable */
.rg-flag { display: none; position: absolute; left: 50%; top: 50%; translate: -50% -50%; pointer-events: none; white-space: nowrap; font-weight: 900; }
.rg-tile[data-off] { background: #E6DFCF; color: rgb(27 15 12 / .45); border-color: rgb(27 15 12 / .35); box-shadow: 3px 3px 0 rgb(27 15 12 / .22); }
.rg-tile[data-off]:active, .rg-tile[data-off].is-pressed { transform: none; box-shadow: 3px 3px 0 rgb(27 15 12 / .22); }
.rg-tile[data-off="out"] .rg-flag {
  display: block; rotate: -10deg; padding: 4px 12px; border: 3px solid var(--ink); border-radius: 8px;
  background: var(--white); color: var(--ink); font-size: clamp(13px, 1.5vw, 18px); letter-spacing: .08em;
  animation: pop-in .35s var(--ease-spring) both;
}
.rg-tile[data-off="out"] .rg-flag::before { content: "売り切れ"; }
.rg-tile[data-off="closed"] .rg-flag { display: block; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 11px; }
.rg-tile[data-off="closed"] .rg-flag::before { content: "14時から販売なし"; }

/* ---------- order screen: the order panel ---------- */
.rg-resume {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px;
  background: var(--orange); border: 2px solid var(--ink); border-radius: 14px; font-size: 13px; font-weight: 900;
}
.rg-resume > span { flex: none; width: 3.2em; line-height: 1.3; } /* "お会計 / がまだ" on two lines, not one character per line */
.rg-resume__list { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-pill {
  min-height: 44px; padding: 0 14px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px;
  font-size: 20px; transition: transform .09s var(--ease-out);
}
.rg-pill:active, .rg-pill.is-pressed { transform: scale(.92); }
.rg-hint { margin: -4px 0 0; font-size: 11px; font-weight: 500; opacity: .6; }
.rg-lines-wrap { position: relative; flex: 1 1 0; min-height: 80px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rg-lines { display: flex; flex-direction: column; }
.rg-empty { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; font-size: 14px; opacity: .4; pointer-events: none; }
.rg-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 2px dashed rgb(27 15 12 / .3); }
.rg-line.is-entering { animation: rg-line-in .32s var(--ease-out) both; }
@keyframes rg-line-in { from { transform: translateX(28px); opacity: 0; } }
.rg-dot { flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.rg-line__name { flex: 1; min-width: 0; font-size: 13px; line-height: 1.15; }
.rg-line__amt { flex: none; min-width: 58px; text-align: right; font-size: 14px; }
.rg-step { flex: none; display: flex; align-items: center; gap: 2px; }
.rg-step__b {
  width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: var(--border); border-radius: 50%;
  background: var(--white); font-size: 22px; font-weight: 900; line-height: 1;
  transition: transform .09s var(--ease-out), background-color .15s;
}
.rg-step__b:active, .rg-step__b.is-pressed { transform: scale(.86); background: var(--pec); }
.rg-step__n { min-width: 24px; text-align: center; font-family: var(--font-label); font-size: 17px; }

.rg-deal {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  background: var(--hot); color: var(--ink); border: var(--border); border-radius: 16px;
  transition: transform .09s var(--ease-out), background-color .2s, opacity .2s;
}
.rg-deal:active:not(:disabled), .rg-deal.is-pressed:not(:disabled) { transform: scale(.97); }
.rg-deal:disabled { background: var(--cream-deep); opacity: .75; cursor: default; }
.rg-deal__t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rg-deal__t b { font-size: 15px; font-weight: 900; }
.rg-deal__t small { font-size: 11px; font-weight: 500; line-height: 1.4; }
.rg-switch { flex: none; position: relative; width: 56px; height: 32px; border: var(--border); border-radius: 999px; background: var(--white); transition: background-color .2s; }
.rg-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: var(--ink);
  transition: transform .28s var(--ease-spring), background-color .2s;
}
.rg-deal[aria-checked="true"] .rg-switch { background: var(--ink); }
.rg-deal[aria-checked="true"] .rg-switch::after { transform: translateX(24px); background: var(--pec); }

.rg-sum { display: grid; gap: 3px; }
.rg-note { margin: 0; text-align: center; font-size: 11px; font-weight: 500; opacity: .7; }

/* ---------- checkout ---------- */
.rg-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.rg-sent {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: var(--green); color: var(--white); border: var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.rg-sent__icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--white); }
.rg-sent__icon path { stroke: var(--green); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .12s var(--ease-out) forwards; }
.rg-sent__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rg-sent__text b { font-size: 19px; }
.rg-sent__text small { font-size: 12px; font-weight: 500; opacity: .92; }
.rg-sent .btn { min-height: 44px; }
.rg-sent__time { font-size: 18px; font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: right; }

.rg-pay { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.rg-recv {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px;
  background: var(--white); border: var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.rg-recv b { display: block; font-size: 17px; }
.rg-recv small { display: block; font-size: 11px; font-weight: 500; }
.rg-recv__amt { font-size: clamp(48px, 6.4vw, 76px); line-height: 1.05; transition: opacity .2s; transform-origin: right center; }
.rg-recv__amt.is-zero { opacity: .25; }
.rg-recv__amt.is-bumped { animation: rg-tick .3s var(--ease-spring); }
.rg-quick { flex: none; display: grid; grid-template-columns: 1.15fr repeat(4, 1fr); gap: 12px; }
.rg-quick .btn { min-height: 54px; padding: 8px; font-family: var(--font-label); font-weight: 900; font-size: 17px; border-radius: 14px; }
.rg-quick .btn:first-child { font-family: var(--font-jp); }
.rg-quick .btn.is-on { --bg: var(--ink); --fg: var(--cream); }
.rg-keys { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(52px, 1fr)); gap: 12px; padding: 0 4px 4px 0; }
.rg-key { min-height: 0; font-family: var(--font-label); font-size: 30px; border-radius: 18px; }
.rg-key--back { --bg: var(--cream-deep); font-family: var(--font-jp); }

.rg-pay--paypay {
  padding: 30px 40px; gap: 22px; background: var(--white); border: var(--border); border-radius: 26px; box-shadow: var(--shadow-lg);
}
.rg-pp__amt { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rg-pp__amt b { font-size: 28px; font-weight: 900; }
.rg-pp__n { font-size: clamp(90px, 13vw, 168px); line-height: 1; }
.rg-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; counter-reset: s; }
.rg-steps li { display: flex; align-items: center; gap: 16px; font-size: clamp(16px, 1.7vw, 20px); line-height: 1.5; counter-increment: s; }
.rg-steps li::before {
  content: counter(s); flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--cream); font-family: var(--font-label); font-weight: 900; font-size: 18px;
}
.rg-pp__foot { margin: auto 0 0; font-size: 13px; font-weight: 500; opacity: .75; }

.rg-chip { margin-left: auto; padding: 4px 11px; border-radius: 999px; background: var(--green); color: var(--white); font-size: 11px; font-weight: 900; white-space: nowrap; }
.rg-ck-lines { display: grid; gap: 6px; max-height: 28vh; overflow-y: auto; padding: 8px 0 14px; border-bottom: 2px dashed rgb(27 15 12 / .4); }
.rg-ck-lines .rg-sum__r { font-size: 13px; }

.rg-seg { position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; border: var(--border); border-radius: 14px; background: var(--white); overflow: hidden; }
.rg-seg::before { content: ""; position: absolute; inset: 0 50% 0 0; background: var(--ink); transition: transform .28s var(--ease-spring); }
.rg-seg[data-i="1"]::before { transform: translateX(100%); }
.rg-seg button { position: relative; z-index: 1; min-height: 50px; padding: 0; border: 0; background: none; font-size: 17px; font-weight: 900; transition: color .2s, transform .09s; }
.rg-seg button:active, .rg-seg button.is-pressed { transform: scale(.96); }
.rg-seg button[aria-checked="true"] { color: var(--cream); }

.rg-cashbox { display: grid; gap: 10px; }
.rg-cashbox .rg-sum__r b { font-size: 18px; }
.rg-change {
  display: flex; align-items: baseline; gap: 10px; padding: 12px 18px; background: var(--pec);
  border: var(--border); border-radius: 16px; font-size: 15px; font-weight: 900; transition: background-color .2s;
}
.rg-change__v { margin-left: auto; font-size: 52px; line-height: 1; }
.rg-change[data-state="idle"] { background: var(--cream-deep); }
.rg-change[data-state="idle"] .rg-change__v { opacity: .35; }
.rg-change[data-state="short"] { background: var(--orange); animation: pulse-warn .7s; }
.rg-change[data-state="short"] .rg-change__v { margin-left: 0; font-size: 44px; }
.rg-change[data-state="short"] .rg-change__l { margin-right: auto; }
.rg-ck-actions { margin-top: auto; display: grid; gap: 12px; }
.rg-ck-actions .btn--danger { min-height: 48px; font-size: 14px; }
.rg-ck-actions .btn--lg { width: 100%; }

/* narrower iPads / split view: panel gets a bit tighter */
@media (max-width: 1100px) {
  .rg { gap: 18px; }
  .rg-tile { padding: 10px; }
  .rg-tile__jp { font-size: 9px; }
  .rg-panel > .btn--lg { font-size: 18px; }
  .rg-ck-actions .btn--danger { font-size: 12.5px; padding: 8px; }
  .rg-total .num, .rg-change__v { font-size: 44px; }
  .rg-pay--paypay { padding: 24px 28px; }
}

/* ---------- 抜き: pick first, then tap a burger ---------- */
.rg-mods { flex: none; display: flex; align-items: stretch; gap: 10px; }
.rg-mods__hint { flex: none; align-self: center; font-size: 12px; font-weight: 900; line-height: 1.25; opacity: .7; }
.rg-mod {
  flex: 1 1 0; min-width: 0; min-height: 52px; padding: 6px 10px; border-radius: 14px; border: var(--border); background: var(--white);
  font: 900 clamp(14px, 1.45vw, 19px)/1.1 var(--font-jp); white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background-color .15s, color .15s, transform .09s var(--ease-out), box-shadow .09s var(--ease-out);
}
.rg-mod:active, .rg-mod.is-pressed { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.rg-mod[aria-pressed="true"] { background: var(--ink); color: var(--cream); animation: bump .3s var(--ease-spring); }
.rg-mod[aria-pressed="true"]::before { content: "✓ "; color: var(--pec); }
.rg-mod:disabled { opacity: .35; box-shadow: none; }
/* while 抜き are picked, the burgers say "tap me next" */
.rg-grid.is-modding .rg-tile:not([data-off]) { outline: 3px dashed var(--ink); outline-offset: 3px; }

/* 抜き on a cart / checkout line — red, like on the kitchen and presenter screens */
.rg-mods-txt {
  display: block; width: fit-content; margin-top: 3px; padding: 1px 6px; border-radius: 6px;
  background: #FDECE8; color: var(--red); font: 900 11px/1.3 var(--font-jp);
}

/* sending: the whole order screen ignores taps (so nothing tapped now is lost), but only the send button looks busy */
.rg-order[data-busy] { opacity: 1; }
.rg-order[data-busy] [data-act="send"] { opacity: .65; }
