/* Customer screen (DESIGN.md "Precision Metric"). One column, max 600px, sticky price bar at the bottom. */
main{max-width:600px;margin:0 auto;padding:20px 16px calc(124px + env(safe-area-inset-bottom,0px))}
.head{display:grid;gap:6px;margin-bottom:20px}
.head p{color:var(--ink-2);font-size:16px;line-height:24px}

/* steps: the order really is a sequence */
.steps{list-style:none;margin:0 0 24px;padding:0;display:flex;align-items:center;gap:8px}
.steps li{display:flex;align-items:center;gap:8px;font-size:14px;line-height:18px;color:var(--ink-2);font-weight:500;white-space:nowrap}
.steps li + li::before{content:"";width:20px;height:1px;background:var(--rule-strong)}
.steps .dot{width:24px;height:24px;border-radius:var(--r-sm);border:1px solid var(--rule-strong);background:var(--sheet);display:grid;place-items:center;font-size:12px;font-weight:600}
.steps li[data-state="now"]{color:var(--ink);font-weight:600}
.steps li[data-state="now"] .dot{background:var(--magenta);border-color:var(--magenta);color:var(--magenta-ink)}
.steps li[data-state="done"] .dot{background:var(--ink);border-color:var(--ink);color:var(--paper)}

/* step 1 */
.capture{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cap{position:relative;border:1px solid var(--rule);border-radius:var(--r);background:var(--sheet);padding:20px 12px;display:grid;gap:4px;justify-items:center;text-align:center;cursor:pointer;min-height:136px;align-content:center;color:var(--ink)}
.cap:hover{background:var(--paper)}
.cap svg{width:28px;height:28px;margin-bottom:6px}
.cap b{font-size:16px;line-height:22px;font-weight:600}
.cap span{font-size:12px;line-height:16px;font-weight:500;letter-spacing:.02em;color:var(--ink-2)}
/* scanner tile: machine slate with calibration corners */
.cap.primary{background:var(--slate);border-color:var(--slate);color:var(--slate-ink)}
.cap.primary span{color:rgba(255,255,255,.7)}
.cap.primary:hover{background:#000}
.cap.primary::before{content:"";position:absolute;inset:10px;pointer-events:none;
  --c:var(--yellow);
  background:
    linear-gradient(var(--c),var(--c)) left top/16px 2px no-repeat,linear-gradient(var(--c),var(--c)) left top/2px 16px no-repeat,
    linear-gradient(var(--c),var(--c)) right top/16px 2px no-repeat,linear-gradient(var(--c),var(--c)) right top/2px 16px no-repeat,
    linear-gradient(var(--c),var(--c)) left bottom/16px 2px no-repeat,linear-gradient(var(--c),var(--c)) left bottom/2px 16px no-repeat,
    linear-gradient(var(--c),var(--c)) right bottom/16px 2px no-repeat,linear-gradient(var(--c),var(--c)) right bottom/2px 16px no-repeat}
.tip{font-size:14px;line-height:20px;color:var(--ink-2);margin-top:14px;padding-top:10px;position:relative}
.tip::before{content:"";position:absolute;left:0;top:0;width:32px;height:2px;background:var(--yellow)}
.busy{display:flex;align-items:center;gap:10px;margin-top:14px;padding:10px 12px;border-radius:var(--r-sm);background:var(--sheet);border:1px solid var(--rule);color:var(--ink);font-weight:500;font-size:14px;line-height:20px}
.spin{width:16px;height:16px;border:2px solid var(--magenta);border-right-color:transparent;border-radius:50%;animation:spin .8s linear infinite;flex:none}
@keyframes spin{to{transform:rotate(360deg)}}
body.dragging .drop-over{display:grid}
.drop-over{display:none;position:fixed;inset:0;z-index:70;place-items:center;background:rgba(209,26,91,.08);border:2px dashed var(--magenta);font-size:20px;font-weight:700;color:var(--magenta);pointer-events:none}

.pages-head{display:flex;justify-content:space-between;align-items:baseline;margin:28px 0 12px;gap:10px;padding-bottom:8px;border-bottom:1px solid var(--rule)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:12px}
.pg{position:relative;display:grid;gap:6px}
.pg .shot{border:1px solid var(--rule);padding:0;background:#fff;border-radius:var(--r-sm);aspect-ratio:210/297;width:100%;overflow:hidden;display:grid;place-items:center}
.pg .shot:hover{border-color:var(--ink-2)}
.pg .shot img{width:100%;height:100%;object-fit:contain;display:block}
.pg.off .shot{opacity:.35}
.pg-meta{display:flex;align-items:center;justify-content:space-between;gap:4px}
.pg-meta .n{font-size:12px;font-weight:600;color:var(--ink-2)}
.pg-check{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--ink-2);cursor:pointer;min-height:32px}
.pg-check input{width:18px;height:18px;accent-color:var(--magenta);margin:0}
.pg .edit-hint{position:absolute;top:6px;right:6px;width:26px;height:26px;border-radius:var(--r-sm);background:var(--sheet);border:1px solid var(--rule);display:grid;place-items:center;pointer-events:none;color:var(--ink)}
.pg .edit-hint svg{width:14px;height:14px}
.empty{border:1px dashed var(--rule-strong);border-radius:var(--r);padding:28px 18px;text-align:center;color:var(--ink-2);font-size:14px;line-height:20px;display:grid;gap:4px;background:var(--sheet)}
.empty b{color:var(--ink);font-size:16px;line-height:22px;font-weight:600}
.range{margin-top:20px;display:grid;gap:8px}
.range-row{display:flex;gap:8px;flex-wrap:wrap}
.range-row .input{flex:1 1 160px;min-width:0}

/* step 2 */
.set{display:grid;gap:10px;padding:18px 0;border-top:1px solid var(--rule)}
.set-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
.ink-dots{display:flex;gap:3px}
.ink-dots i{width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 1px var(--rule)}
.preview{display:flex;gap:16px;align-items:center;background:var(--sheet);border:1px solid var(--rule);border-radius:var(--r);padding:12px 16px;margin-bottom:6px;position:sticky;top:calc(62px + env(safe-area-inset-top,0px));z-index:5}
.pv-stage{width:96px;height:96px;flex:none;display:grid;place-items:center;background:var(--paper);border-radius:var(--r-sm)}
.pv-sheets{position:relative;display:grid;place-items:center;isolation:isolate}
.pv-sheet{background:#fff;border:1px solid var(--rule-strong);border-radius:1px;display:grid;gap:3px;padding:5px;overflow:hidden}
.pv-sheet.back{position:absolute;transform:translate(8px,6px);opacity:.75;z-index:-1}
.pv-cell{background:#fff;display:grid;place-items:center;overflow:hidden;min-width:0;min-height:0;outline:1px dashed #d4d4d8}
.pv-cell img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.bw .pv-cell img{filter:grayscale(1)}
.pv-text{display:grid;gap:2px;min-width:0;font-size:14px;line-height:20px;color:var(--ink-2)}
.pv-text strong{font-size:16px;line-height:22px;font-weight:600;color:var(--ink)}
@media (max-width:380px){.preview{gap:12px;padding:10px 12px}.pv-stage{width:80px;height:80px}}

/* step 3 */
.closed-note{background:var(--bad-soft);color:var(--bad);border-radius:var(--r-sm);padding:12px 14px;font-weight:500;font-size:14px;margin-bottom:18px}
.slip{padding:16px;font-size:14px;line-height:20px;margin:0 0 24px;display:grid;gap:8px}
.slip .ln{display:flex;justify-content:space-between;gap:12px}
.slip .ln span:first-child{color:var(--ink-2)}
.slip .ln span:last-child{text-align:right;font-weight:500}
.slip .sub{border-top:1px solid var(--rule);padding-top:10px;margin-top:2px}
.slip .tot{border-top:1px solid var(--ink);margin-top:4px;padding-top:12px;font-size:20px;line-height:26px;font-weight:700}
.slip .tot span:first-child{color:var(--ink)}
.slip .tot span:last-child{font-weight:700}
.form{display:grid;gap:16px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:440px){.row2{grid-template-columns:1fr}}

/* bottom bar */
.bar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--sheet);border-top:1px solid var(--rule);padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px))}
.bar-in{max-width:600px;margin:0 auto;display:flex;align-items:center;gap:12px}
.bar-sum{flex:1;min-width:0;display:grid}
.bar-sum b{font-size:24px;line-height:30px;font-weight:700;letter-spacing:-.015em}
.bar-sum span{font-size:12px;line-height:16px;font-weight:500;letter-spacing:.02em;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar .go{min-height:48px;padding-inline:22px;font-size:15px}
.bar .back{width:48px;min-height:48px;padding:0;flex:none}
.myjobs{position:fixed;right:16px;bottom:calc(88px + env(safe-area-inset-bottom,0px));z-index:31;box-shadow:var(--lift)}
.myjobs.ready{background:var(--ok);border-color:var(--ok);color:var(--ok-ink)}

/* tickets */
.tickets{display:grid;gap:16px;margin:4px 0 20px}
.ticket{padding:20px 16px 16px;display:grid;gap:16px}
.ticket.ready{border-color:var(--ok-line);box-shadow:inset 0 3px 0 var(--ok)}
.t-head{text-align:center;display:grid;gap:2px}
.t-head .lbl{font-size:12px;line-height:16px;font-weight:500;letter-spacing:.04em;color:var(--ink-2)}
.t-token{font-size:72px;line-height:76px;font-weight:600;letter-spacing:-.03em}
.t-msg{font-size:16px;line-height:22px;font-weight:600;margin-top:4px}
.ticket.ready .t-token,.ticket.ready .t-msg{color:var(--ok-text)}
.ticket.rejected .t-msg{color:var(--bad)}
.t-shot{font-size:12px;line-height:16px;font-weight:500;color:var(--ink-2);text-align:center}
.track{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
.track li{display:grid;gap:6px;font-size:12px;line-height:16px;font-weight:500;color:var(--ink-2);text-align:center}
.track li::before{content:"";height:4px;border-radius:1px;background:var(--rule)}
.track li.on{color:var(--ink)}
.track li.on::before{background:var(--ink)}
.track li.now::before{background:var(--magenta);animation:pulse 1.6s ease-in-out infinite}
.ticket.ready .track li.now::before{background:var(--ok);animation:none}
@keyframes pulse{50%{opacity:.4}}
.t-lines{border-top:1px solid var(--rule);padding-top:12px;display:grid;gap:6px;font-size:14px;line-height:20px}
.t-lines .ln{display:flex;justify-content:space-between;gap:10px}
.t-lines .ln span:first-child{color:var(--ink-2)}
.t-lines .tot{font-size:20px;line-height:26px;font-weight:700}
.t-lines .tot span:first-child{color:var(--ink)}
.t-pay{display:grid;gap:10px}
.t-pay .upi{display:flex;align-items:center;gap:8px;background:var(--paper);border:1px solid var(--rule);border-radius:var(--r-sm);padding:4px 4px 4px 12px;font-size:14px;font-weight:500}
.t-pay .upi span{flex:1;min-width:0;overflow-wrap:anywhere}
.t-pay p{font-size:12px;line-height:16px;color:var(--ink-2)}
.t-paid{font-weight:600;font-size:14px;padding:10px 12px;border-radius:var(--r-sm);text-align:center;border:1px solid var(--rule)}
.t-paid.claimed{background:var(--warn-soft);color:var(--warn)}
.t-paid.paid{background:var(--ok-soft);color:var(--ok-text);border-color:var(--ok-line)}

/* editor: a viewfinder in machine slate */
.modal.editor{padding:0;place-items:stretch}
.ed{background:var(--sheet);width:100%;height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;max-width:720px;margin:0 auto;padding:calc(10px + env(safe-area-inset-top,0px)) 16px calc(14px + env(safe-area-inset-bottom,0px))}
@media (min-width:760px){.modal.editor{padding:24px;place-items:center}.ed{height:min(900px,100%);border-radius:var(--r);box-shadow:var(--lift)}}
.ed-top{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-bottom:8px}
.ed-top h2{font-size:20px;line-height:26px;font-weight:600}
.ed-move{display:flex;gap:2px}
.ed-stage{position:relative;background:var(--slate);border-radius:var(--r);overflow:hidden;touch-action:none;min-height:200px}
.ed-stage canvas{position:absolute;left:0;top:0}
.ed-stage svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.ed-stage .shade{fill:rgba(0,0,0,.5)}
.ed-stage .edge{fill:none;stroke:var(--yellow);stroke-width:2}
.ed-stage .handle{fill:#fff;stroke:var(--yellow);stroke-width:3;cursor:grab}
.ed-stage .handle-hit{fill:transparent;cursor:grab}
.ed-stage .handle.active{fill:var(--yellow)}
.ed-help{font-size:12px;line-height:16px;font-weight:500;color:var(--ink-2);text-align:center;padding:10px 0 2px}
.ed-tools{display:grid;gap:8px;padding:8px 0}
.ed-tools .choice{min-height:40px;padding:8px}
.ed-row{display:flex;gap:8px;flex-wrap:wrap}
.ed-row .btn{flex:1 1 auto}
.ed-actions{display:flex;gap:8px;flex-wrap:wrap;border-top:1px solid var(--rule);padding-top:12px}
.ed-actions .btn{flex:1 1 auto}
.ed-actions #edDelete{flex:0 0 auto}
.ed.working .ed-stage::after{content:"";position:absolute;inset:0;background:rgba(32,33,36,.5)}

/* shop finder */
.find-form{display:grid;gap:8px}
.err-line{color:var(--bad);font-size:14px;line-height:20px}
.owner-card{margin-top:32px;padding:20px 16px;border:1px solid var(--rule);border-radius:var(--r);background:var(--sheet);display:grid;gap:8px;justify-items:start}
.owner-card p{color:var(--ink-2);font-size:14px;line-height:20px;margin-bottom:6px}
