/* Barista (counter) screen — staff phone prototype */
body.barista {
  min-height: 100vh;
  display: grid; grid-template-columns: auto minmax(0, 420px); justify-content: center; align-items: center;
  gap: 48px; padding-block: 32px; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  background: var(--roast-100);
}
body.barista.render { background: transparent; }

/* ---------- device ---------- */
.phone {
  --pw: 375px; --ph: 790px;
  inline-size: calc(var(--pw) + 22px); block-size: calc(var(--ph) + 22px);
  border-radius: var(--r-device); background: #17100B; padding: 11px; position: relative;
  box-shadow: var(--shadow-object), inset 0 0 0 1.5px #3A2A21;
}
.screen {
  inline-size: var(--pw); block-size: var(--ph); border-radius: 34px; overflow: hidden; position: relative;
  background: var(--paper); display: flex; flex-direction: column; isolation: isolate;
}
.statusbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 26px 4px; font-family: var(--font-display); font-weight: 600; font-size: 14px; direction: ltr; }
.statusbar .notch { inline-size: 92px; block-size: 26px; border-radius: 14px; background: #17100B; }
.statusbar .sys { display: flex; gap: 5px; align-items: center; }
.statusbar .sys i { display: block; inline-size: 17px; block-size: 10px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; }
.statusbar .sys i::after { content: ""; position: absolute; inset: 1.5px; inset-inline-end: 4px; background: currentColor; border-radius: 1px; }

/* ---------- app chrome ---------- */
.app-h { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; }
.app-h .mark { inline-size: 30px; block-size: 30px; border-radius: 8px; background: var(--espresso); display: grid; place-items: center; }
.app-h .mark img { inline-size: 20px; }
.app-h b { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: block; line-height: 1.2; }
.app-h small { font-size: 12px; color: var(--roast-700); }
.app-h .who { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; background: var(--foam); border: 1px solid var(--roast-300); border-radius: 999px; padding: 3px 10px 3px 4px; }
.app-h .who .av { inline-size: 22px; block-size: 22px; border-radius: 50%; background: var(--nile); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }

/* ---------- viewfinder ---------- */
.vf {
  margin: 0 14px; border-radius: 22px; background: #1A120D; position: relative; overflow: hidden; flex: 1 1 auto; min-block-size: 300px;
  display: grid; place-items: center; cursor: pointer; border: 0; color: #fff; padding: 0;
}
.vf::before { /* a soft, out-of-focus counter */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 30% 75%, rgba(181, 138, 76, .22), transparent 70%),
    radial-gradient(50% 35% at 75% 25%, rgba(243, 238, 230, .08), transparent 70%);
}
.vf .frame { position: relative; inline-size: 62%; aspect-ratio: 1; }
.vf .frame i { position: absolute; inline-size: 34px; block-size: 34px; border: 4px solid #fff; }
.vf .frame i:nth-child(1) { inset-block-start: 0; inset-inline-start: 0; border-inline-end: 0; border-block-end: 0; border-start-start-radius: 14px; }
.vf .frame i:nth-child(2) { inset-block-start: 0; inset-inline-end: 0; border-inline-start: 0; border-block-end: 0; border-start-end-radius: 14px; }
.vf .frame i:nth-child(3) { inset-block-end: 0; inset-inline-start: 0; border-inline-end: 0; border-block-start: 0; border-end-start-radius: 14px; }
.vf .frame i:nth-child(4) { inset-block-end: 0; inset-inline-end: 0; border-inline-start: 0; border-block-start: 0; border-end-end-radius: 14px; }
.vf .line { position: absolute; inset-inline: 6%; block-size: 2px; background: var(--karkadeh); box-shadow: 0 0 14px 2px rgba(163, 36, 59, .7); inset-block-start: 10%; animation: scan 2.4s ease-in-out infinite alternate; }
@keyframes scan { to { inset-block-start: 90%; } }
.vf .ghost { position: absolute; inset: 18%; border-radius: 10px; background: #fff; opacity: 0; transition: opacity .2s; display: grid; place-items: center; }
.vf .ghost svg { inline-size: 86%; block-size: auto; }
.vf.locked .ghost { opacity: .95; }
.vf.locked .frame i { border-color: #9FD8C8; }
.vf.locked .line { display: none; }
.vf-hint { position: absolute; inset-block-end: 18px; inset-inline: 16px; text-align: center; color: #fff; }
.vf-hint b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.vf-hint small { font-size: 12px; color: #CDBFB4; }

.today { display: flex; gap: 10px; padding: 12px 16px 4px; }
.today div { flex: 1; background: var(--foam); border: 1px solid var(--roast-300); border-radius: 12px; padding: 8px 12px; }
.today small { display: block; font-size: 11px; color: var(--roast-700); }
.today b { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.app-actions { display: grid; gap: 8px; padding: 8px 16px 22px; }
.app-actions .btn { min-block-size: 50px; font-size: 15px; }
.linkish { border: 0; background: none; color: var(--roast-700); font-size: 13px; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- bottom sheet ---------- */
.sheet-scrim { position: absolute; inset: 0; background: rgba(23, 16, 11, .45); z-index: 5; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 6;
  background: var(--paper); border-radius: 26px 26px 0 0; padding: 10px 18px 22px;
  display: grid; gap: 14px; animation: rise .28s var(--ease-out); max-block-size: 92%; overflow-y: auto;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { inline-size: 40px; block-size: 5px; border-radius: 3px; background: var(--roast-300); justify-self: center; }
.cust { display: flex; align-items: center; gap: 12px; }
.cust .av { inline-size: 48px; block-size: 48px; border-radius: 50%; background: var(--espresso); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 20px; flex: none; }
.cust h2 { font-size: 22px; }
.cust .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-block-start: 4px; }
.cust .x { margin-inline-start: auto; align-self: flex-start; border: 0; background: var(--roast-100); inline-size: 34px; block-size: 34px; border-radius: 50%; font-size: 16px; }

.progress { background: var(--foam); border: 1px solid var(--roast-300); border-radius: 16px; overflow: hidden; }
.progress .top { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 8px; }
.progress .count { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; }
.progress .count small { font-size: 16px; font-weight: 500; color: var(--roast-700); }
.progress .left { font-size: 13px; color: var(--roast-700); }
.progress .strip svg { display: block; inline-size: 100%; block-size: auto; }

.qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qty span { font-weight: 600; font-size: 15px; }
.qty .stepper button { inline-size: 48px; block-size: 48px; font-size: 24px; }
.qty .stepper output { font-size: 22px; min-inline-size: 40px; }

.big-btn {
  inline-size: 100%; min-block-size: 68px; border-radius: 18px; border: 0;
  background: var(--karkadeh); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 24px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 22px -12px rgba(163, 36, 59, .8);
  transition: transform .1s, background .15s;
}
.big-btn:active { transform: scale(.98); }
.big-btn:hover { background: var(--karkadeh-deep); }
.big-btn svg { inline-size: 26px; block-size: 26px; }
.big-btn.nile { background: var(--nile); box-shadow: 0 10px 22px -12px rgba(20, 92, 87, .8); }
.sub-btn { inline-size: 100%; min-block-size: 46px; border-radius: 14px; border: 1px solid var(--roast-300); background: var(--foam); font-weight: 600; }

/* success */
.done { display: grid; justify-items: center; text-align: center; gap: 8px; padding-block: 8px 4px; }
.done .tick { inline-size: 84px; block-size: 84px; border-radius: 50%; background: var(--nile); display: grid; place-items: center; animation: pop .45s var(--ease-stamp); }
.done .tick svg { inline-size: 46px; block-size: 46px; color: #fff; stroke-width: 2.4; }
.done.reward .tick { background: var(--karkadeh); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done h2 { font-size: 30px; }
.done p { color: var(--roast-700); font-size: 14px; }
.timer-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--nile-tint); color: var(--nile); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; }
.timer-chip svg { inline-size: 16px; block-size: 16px; }
.autoback { block-size: 4px; background: var(--roast-100); border-radius: 2px; overflow: hidden; }
.autoback i { display: block; block-size: 100%; background: var(--nile); inline-size: 0; animation: fill 3.2s linear forwards; }
@keyframes fill { to { inline-size: 100%; } }
.tc-cup.landed .tc-cup-in { animation: land .5s var(--ease-stamp); transform-box: fill-box; transform-origin: center; }
@keyframes land { 0% { transform: scale(1.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* warnings */
.warn-box { display: grid; gap: 6px; border-radius: 16px; padding: 14px; background: #FBF1DF; color: #6E470E; }
.warn-box b { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: #4F330A; }
.warn-box.k { background: var(--karkadeh-tint); color: var(--karkadeh-deep); }
.warn-box.k b { color: var(--karkadeh-deep); }

/* keypad screens */
.pad-screen { position: absolute; inset: 0; z-index: 7; background: var(--paper); display: flex; flex-direction: column; animation: rise .25s var(--ease-out); }
.pad-head { display: flex; align-items: center; gap: 10px; padding: 52px 16px 6px; }
.pad-head button { border: 0; background: var(--roast-100); inline-size: 36px; block-size: 36px; border-radius: 50%; font-size: 18px; }
.pad-head h2 { font-size: 18px; }
.pad-body { padding: 10px 18px; display: grid; gap: 12px; }
.phone-field { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: .04em; direction: ltr; text-align: center; padding: 14px; border-radius: 14px; background: var(--foam); border: 1.5px solid var(--nile); min-block-size: 64px; font-variant-numeric: tabular-nums; }
.phone-field .ph { color: var(--roast-300); }
.boxes { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.boxes span { inline-size: 54px; block-size: 62px; border-radius: 12px; border: 1.5px solid var(--roast-300); background: var(--foam); display: grid; place-items: center; font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.boxes span.on { border-color: var(--nile); }
.boxes.pin span { inline-size: 22px; block-size: 22px; border-radius: 50%; }
.boxes.pin span.on { background: var(--espresso); border-color: var(--espresso); }
.keypad { margin-block-start: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 16px 22px; direction: ltr; }
.keypad button { block-size: 56px; border: 0; border-radius: 14px; background: var(--foam); font-family: var(--font-display); font-size: 24px; font-weight: 500; box-shadow: 0 1px 0 var(--roast-300); }
.keypad button:active { background: var(--roast-100); }
.result { display: flex; gap: 12px; align-items: center; background: var(--foam); border: 1px solid var(--roast-300); border-radius: 16px; padding: 12px; }
.result .av { inline-size: 42px; block-size: 42px; border-radius: 50%; background: var(--roast-700); color: #fff; display: grid; place-items: center; font-weight: 700; }
.result b { font-family: var(--font-display); font-weight: 600; }
.result small { display: block; font-size: 12px; color: var(--roast-700); }
.result .p { margin-inline-start: auto; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.reasons button { border: 1px solid var(--roast-300); background: var(--foam); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.reasons button[aria-pressed="true"] { background: var(--espresso); color: #fff; border-color: var(--espresso); }

/* ---------- scenario panel ---------- */
.guide { display: grid; gap: 18px; align-content: center; }
.guide h1 { font-size: var(--fs-xl); }
.guide > p { color: var(--roast-700); }
.scen { display: grid; gap: 8px; }
.scen button {
  text-align: start; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; align-items: center;
  border: 1px solid var(--roast-300); background: var(--foam); border-radius: 12px; padding: 10px 12px;
}
.scen button:hover { border-color: var(--roast-500); }
.scen button[aria-pressed="true"] { border-color: var(--nile); box-shadow: 0 0 0 1px var(--nile) inset; }
.scen .ic { grid-row: span 2; inline-size: 34px; block-size: 34px; border-radius: 10px; background: var(--roast-100); display: grid; place-items: center; color: var(--espresso); }
.scen .ic svg { inline-size: 18px; block-size: 18px; }
.scen b { font-size: 14px; }
.scen small { font-size: 12px; color: var(--roast-700); }
.stopwatch { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--espresso); color: #fff; }
.stopwatch b { font-family: var(--font-display); font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.stopwatch span { font-size: 13px; color: #CDBFB4; }
.guide .back { font-size: var(--fs-sm); }

@media (max-width: 900px) {
  body.barista { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; background: var(--paper); }
  .phone { inline-size: 100%; block-size: auto; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .screen { inline-size: 100%; block-size: 100vh; block-size: 100dvh; border-radius: 0; }
  .statusbar { display: none; }
  .app-h { padding-block-start: max(12px, env(safe-area-inset-top, 0px)); }
  .pad-head { padding-block-start: max(16px, env(safe-area-inset-top, 0px)); }
  .guide { padding: 28px max(16px, env(safe-area-inset-left, 0px)) 40px; }
}
