/* Last Call — Night Receipt */
:root {
  --night: #0e0b14;
  --night-2: #1a1524;
  --night-3: #251e33;
  --line: #3a3150;
  --ink: #f4eefc;
  --ink-dim: #c9bfdb; /* 10.9:1 on night */
  --paper: #f5efe3;
  --paper-ink: #1b1622;
  --paper-dim: #5a5068; /* 6.6:1 on paper */
  --amber: #ffb224;
  --coral: #ff5c7a;
  --mint: #5ce1c6;
  --lilac: #b69cff;
  --sky: #6ec1ff;
  --r: 14px;
  --mono: 'Space Mono', ui-monospace, monospace;
  --sans: 'Rubik', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--sans); font-size: 18px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; background:
  radial-gradient(120% 60% at 80% -10%, rgba(255,178,36,.18), transparent 60%),
  radial-gradient(80% 50% at 0% 0%, rgba(255,92,122,.10), transparent 60%),
  var(--night); background-attachment: fixed; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; direction: ltr; unicode-bidi: isolate; }

#app { max-width: 480px; margin: 0 auto; padding: 18px 18px 140px; min-height: 100dvh; position: relative; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; margin-bottom: 8px; }
.brand { font-weight: 800; letter-spacing: -.01em; font-size: 20px; display: flex; gap: 8px; align-items: center; }
.brand .paid { color: var(--amber); }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber), 0 0 24px rgba(255,178,36,.6); }
.icon-btn { min-width: 48px; min-height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--night-2); display: grid; place-items: center; font-size: 22px; }

h1 { font-size: 40px; line-height: 1.05; font-weight: 800; margin: 8px 0 12px; letter-spacing: -.02em; }
h2 { font-size: 26px; line-height: 1.15; font-weight: 800; margin: 4px 0 8px; }
.lead { color: var(--ink-dim); margin: 0 0 20px; font-size: 18px; }
.neon { color: var(--amber); text-shadow: 0 0 18px rgba(255,178,36,.55); }
.muted { color: var(--ink-dim); }
.small { font-size: 15px; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; padding: 12px 20px; border-radius: var(--r); border: 0; font-size: 20px; font-weight: 700; text-decoration: none; transition: transform .08s ease, box-shadow .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--amber); color: #1b1100; box-shadow: 0 8px 30px rgba(255,178,36,.35), inset 0 -3px 0 rgba(0,0,0,.15); }
.btn-ghost { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--amber); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .sub { display: block; font-size: 14px; font-weight: 500; opacity: .8; }
.btn-stack { display: grid; gap: 12px; }
.link-btn { background: none; border: 0; color: var(--amber); text-decoration: underline; text-underline-offset: 4px; min-height: 48px; padding: 8px 4px; font-size: 17px; }

.dock { position: fixed; inset: auto 0 0 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--night) 70%, transparent); z-index: 10; }
.dock-inner { max-width: 444px; margin: 0 auto; display: grid; gap: 10px; }

/* receipt */
.receipt { --zz: 10px; position: relative; background: var(--paper); color: var(--paper-ink); padding: 26px 18px; margin: 18px 0; filter: drop-shadow(0 18px 30px rgba(0,0,0,.5));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zz) * 2) var(--zz) repeat-x,
                conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--zz) * 2) var(--zz) repeat-x,
                linear-gradient(#000 0 0) center / 100% calc(100% - var(--zz) * 2 + 1px) no-repeat;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zz) * 2) var(--zz) repeat-x,
                conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--zz) * 2) var(--zz) repeat-x,
                linear-gradient(#000 0 0) center / 100% calc(100% - var(--zz) * 2 + 1px) no-repeat; }
.receipt .r-head { text-align: center; font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--paper-dim); margin-bottom: 6px; }
.receipt .r-title { text-align: center; font-weight: 800; font-size: 22px; margin-bottom: 4px; }
.receipt hr { border: 0; border-top: 2px dashed #b9ae9c; margin: 12px 0; }
.r-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; }
.r-total { font-size: 24px; font-weight: 800; }
.tilt { transform: rotate(-2.5deg); }

/* hero receipt */
.hero-receipt { width: 82%; margin: 6px auto 26px; padding: 22px 18px; }
.hero-receipt .r-line { font-size: 16px; }
.chip { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; font-size: 15px; color: #1b1622; flex: none; border: 2px solid var(--paper); }
.c-amber { background: var(--amber); } .c-coral { background: var(--coral); } .c-mint { background: var(--mint); } .c-lilac { background: var(--lilac); } .c-sky { background: var(--sky); }
.chips { display: inline-flex; flex-direction: row; }
.chips .chip + .chip { margin-inline-start: -10px; }
.chip.lg { width: 48px; height: 48px; font-size: 20px; border-color: var(--night); }

/* inputs */
label.field { display: grid; gap: 8px; margin: 14px 0; font-weight: 600; }
.input { width: 100%; min-height: 58px; padding: 12px 16px; border-radius: var(--r); border: 2px solid var(--line); background: var(--night-2); font-size: 20px; }
.input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,178,36,.2); }
.input::placeholder { color: #8f84a3; }

.colors { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.color-opt { width: 52px; height: 52px; border-radius: 50%; border: 3px solid transparent; display: grid; place-items: center; font-weight: 800; color: #1b1622; font-size: 20px; }
.color-opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--night), 0 0 20px currentColor; }

/* code boxes */
.code-wrap { position: relative; margin: 18px 0 8px; }
.code-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; direction: ltr; }
.code-box { height: 84px; border-radius: 16px; border: 2px solid var(--line); background: var(--night-2); display: grid; place-items: center; font-family: var(--mono); font-size: 44px; font-weight: 700; }
.code-box.on { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,178,36,.18), 0 0 26px rgba(255,178,36,.35); }
.code-input { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; }

.neon-code { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; direction: ltr; margin: 20px 0; }
.neon-code span { height: 104px; border-radius: 18px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 64px; color: var(--amber); background: #15101e; border: 2px solid var(--amber); text-shadow: 0 0 14px rgba(255,178,36,.8), 0 0 40px rgba(255,178,36,.45); box-shadow: inset 0 0 22px rgba(255,178,36,.18), 0 0 24px rgba(255,178,36,.25); animation: flicker 6s infinite; }
.neon-code span:nth-child(3) { animation-delay: 1.7s; }
@keyframes flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .55; } 98% { opacity: 1; } 99% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .neon-code span { animation: none; } * { transition: none !important; } }

.qr-card { width: 64%; margin: 0 auto; padding: 22px; }
.qr-card img { width: 100%; display: block; aspect-ratio: 1; }

.people { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 10px; }
.person { display: grid; justify-items: center; gap: 6px; min-width: 64px; font-size: 15px; text-align: center; }
.person .chip { width: 52px; height: 52px; font-size: 20px; border-color: var(--night); }
.person.wait .chip { background: transparent; border: 2px dashed var(--line); color: var(--ink-dim); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.badge-ok { color: var(--mint); font-size: 13px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-sm { min-height: 56px; font-size: 17px; }

/* scan */
.drop { display: grid; place-items: center; text-align: center; gap: 8px; min-height: 220px; border: 2px dashed var(--amber); border-radius: 20px; background: rgba(255,178,36,.06); padding: 24px; cursor: pointer; }
.drop .big { font-size: 54px; line-height: 1; }
.printing { overflow: hidden; height: 260px; position: relative; margin: 30px auto; width: 78%; }
.printing .receipt { animation: print 2.4s ease-in-out infinite alternate; margin: 0; }
@keyframes print { from { transform: translateY(-70%); } to { transform: translateY(0); } }
.skel { height: 14px; border-radius: 4px; background: #ddd3c2; margin: 10px 0; }

/* item editor */
.edit-row { display: grid; grid-template-columns: 58px 1fr 92px 44px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #c8bda9; }
.edit-row input { min-height: 48px; padding: 8px; border-radius: 10px; border: 1.5px solid #cfc4b0; background: #fffaf0; color: var(--paper-ink); font-size: 17px; width: 100%; }
.edit-row input:focus { outline: 2px solid #b07400; }
.edit-row input.num { font-family: var(--mono); text-align: center; direction: ltr; }
.edit-row .del { min-height: 44px; border: 0; background: none; color: #a3243f; font-size: 22px; }
.edit-head { display: grid; grid-template-columns: 58px 1fr 92px 44px; gap: 6px; font-size: 13px; color: var(--paper-dim); font-weight: 600; }
.add-row { width: 100%; min-height: 56px; margin-top: 10px; border: 2px dashed #b9ae9c; background: none; border-radius: 12px; color: var(--paper-ink); font-weight: 700; }
.warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255,92,122,.12); border: 1.5px solid var(--coral); color: #ffd3dc; font-size: 16px; margin: 10px 0; }
.ok { background: rgba(92,225,198,.1); border-color: var(--mint); color: #c9fff3; }
.paper-warn { color: #8a1830; font-weight: 600; font-size: 15px; }

/* picking */
.progress { position: sticky; top: 0; z-index: 5; background: rgba(14,11,20,.92); backdrop-filter: blur(8px); margin: 0 -18px; padding: 10px 18px 12px; border-bottom: 1px solid var(--line); }
.bar { height: 10px; border-radius: 6px; background: var(--night-3); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--amber)); border-radius: 6px; transition: width .3s; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 15px; font-weight: 700; min-height: 32px; }
.pill-coral { background: var(--coral); color: #2a0510; }
.pill-mint { background: var(--mint); color: #062a22; }
.filters { display: flex; gap: 8px; margin: 12px 0 0; }
.filters button { min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--night-2); font-size: 15px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--night); border-color: var(--ink); font-weight: 700; }

.items { padding: 22px 0; }
.item { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 2px dashed #cfc4b0; padding: 4px 6px 4px 12px; padding-inline-start: 12px; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; transition: background-color .18s; }
.item .units { grid-column: 1 / -1; }
.item:last-child { border-bottom: 0; }
.item-main { display: flex; width: 100%; touch-action: manipulation; align-items: center; gap: 12px; min-height: 68px; padding: 8px 4px; background: none; border: 0; color: inherit; text-align: start; border-radius: 10px; }
.item-main .name { font-weight: 700; font-size: 18px; flex: 1; }
.item-main .meta { display: block; font-size: 14px; font-weight: 500; color: var(--paper-dim); }
.item-main .price { font-family: var(--mono); font-weight: 700; font-size: 17px; direction: ltr; }
.check { width: 30px; height: 30px; border-radius: 8px; border: 2.5px solid #9d917f; display: grid; place-items: center; flex: none; transition: background-color .15s, border-color .15s, transform .15s; }
.check svg { width: 20px; height: 20px; fill: none; stroke: var(--amber); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.item.mine .check svg { stroke-dashoffset: 0; }
.item.just.mine .check svg { animation: draw .22s ease-out; }
.item.just .check { animation: press .22s ease-out; }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes press { 40% { transform: scale(.82); } 100% { transform: scale(1); } }
.item.mine { background: linear-gradient(90deg, transparent, rgba(255,178,36,.28)); }
.item.mine::before { content: ''; position: absolute; inset: 6px auto 6px 0; inset-inline-start: 0; width: 6px; border-radius: 3px; background: #e39500; }
.item.mine .check { background: #1b1622; border-color: #1b1622; }
.item.free .meta.status { color: #a3243f; font-weight: 700; }
.item.free { background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255,92,122,.07) 10px 20px); }
.units { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px 12px; }
.unit { min-height: 52px; min-width: 92px; padding: 6px 12px; border-radius: 12px; border: 2px dashed #a3243f; background: #fff7f0; color: var(--paper-ink); display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.unit.taken { border-style: solid; border-color: #9d917f; background: #ece4d5; }
.unit.mine { border: 2.5px solid #1b1622; background: var(--amber); }
.unit .chip { width: 26px; height: 26px; font-size: 13px; border-width: 1.5px; }
.item-tools { display: flex; gap: 8px; padding: 0 4px 10px; }
.mini { min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid #9d917f; background: transparent; color: var(--paper-ink); font-size: 14px; font-weight: 600; }

.mybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--night-2); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 10px 10px; padding-inline-start: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.mybar .amt { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--amber); direction: ltr; }
.mybar .btn { width: auto; min-width: 140px; }

/* summary */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.seg button { min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--night-2); font-family: var(--mono); font-weight: 700; font-size: 18px; }
.seg button[aria-pressed="true"] { background: var(--amber); color: #1b1100; border-color: var(--amber); box-shadow: 0 0 20px rgba(255,178,36,.35); }
.who { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 2px dashed #cfc4b0; }
.who:last-of-type { border-bottom: 0; }
.who .nm { font-weight: 800; font-size: 19px; }
.who .its { font-size: 14px; color: var(--paper-dim); line-height: 1.35; }
.who .amt { font-family: var(--mono); font-size: 24px; font-weight: 700; direction: ltr; }
.who .paid { font-size: 13px; color: #0b6b56; font-weight: 700; }
.pay-card { background: var(--night-2); border: 2px solid var(--amber); border-radius: 22px; padding: 20px; margin: 20px 0; box-shadow: 0 0 40px rgba(255,178,36,.15); }
.pay-card .big { font-family: var(--mono); font-size: 52px; font-weight: 700; color: var(--amber); direction: ltr; text-align: start; line-height: 1.1; }
.btn-bit { background: #00c6b4; color: #04201c; }
.btn-paybox { background: #2d6bff; color: #fff; }
.toggle { display: flex; align-items: center; gap: 14px; min-height: 60px; width: 100%; background: none; border: 2px solid var(--line); border-radius: 14px; padding: 8px 16px; margin-top: 12px; font-size: 18px; font-weight: 600; text-align: start; }
.toggle .sw { width: 52px; height: 30px; border-radius: 15px; background: var(--night-3); position: relative; flex: none; border: 2px solid var(--line); }
.toggle .sw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-dim); transition: inset-inline-start .2s; }
.toggle[aria-pressed="true"] { border-color: var(--mint); }
.toggle[aria-pressed="true"] .sw { background: var(--mint); border-color: var(--mint); }
.toggle[aria-pressed="true"] .sw::after { inset-inline-start: 25px; background: #062a22; }

.toast { position: fixed; top: 16px; inset-inline: 16px; max-width: 440px; margin: 0 auto; z-index: 50; background: var(--ink); color: var(--night); padding: 14px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: drop .25s ease; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.foot { text-align: center; color: var(--ink-dim); font-size: 15px; margin-top: 18px; }
.center { text-align: center; }
.spacer { height: 12px; }

/* ===== v2 ===== */
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--amber); color: #1b1100; padding: 10px 14px; border-radius: 10px; z-index: 100; font-weight: 700; }
.skip:focus { top: 8px; }
a.brand { color: var(--ink); text-decoration: none; min-height: 48px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { color: var(--ink); text-decoration: none; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.conn i { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.conn.bad { color: #ffd3dc; background: rgba(255,92,122,.15); border: 1.5px solid var(--coral); padding: 6px 12px; border-radius: 999px; }
.conn.bad i { background: var(--coral); box-shadow: 0 0 10px var(--coral); animation: pulse 1s infinite; }
.h3 { margin: 24px 0 6px; font-size: 19px; }
.ltr-in { direction: ltr; text-align: right; }
.resume { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 10px 18px; margin: -6px 0 6px; border-radius: 14px; background: rgba(92,225,198,.1); border: 1.5px solid var(--mint); color: #c9fff3; text-decoration: none; font-weight: 600; }

/* scanning printer */
.printer { position: relative; width: 82%; margin: 26px auto; height: 330px; }
.printer .slot { position: absolute; top: 0; inset-inline: -14px; height: 16px; border-radius: 10px; background: #2a2238; box-shadow: inset 0 -4px 0 #1a1524, 0 0 30px rgba(255,178,36,.25); z-index: 2; }
.printer .paper-out { position: absolute; top: 8px; inset-inline: 0; overflow: hidden; height: 320px; }
.printer .receipt { margin: 0; animation: feed 2.6s cubic-bezier(.3,.7,.4,1) both; }
@keyframes feed { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.pline { opacity: 0; animation: ink .25s ease-out forwards; animation-delay: calc(400ms + var(--i) * 260ms); }
@keyframes ink { to { opacity: 1; } }
.ghost { background: #ddd3c2; color: transparent; border-radius: 4px; }
.paper-ok { color: #0b6b56; font-weight: 700; font-size: 15px; margin: 6px 0 0; }
.paper-warn { margin: 6px 0 0; }

/* picking */
.prog-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.remain { font-size: 32px; font-weight: 700; color: var(--coral); line-height: 1.1; direction: ltr; text-align: right; }
.remain.zero { color: var(--mint); }
.bump { animation: bump .32s ease-out; display: inline-block; }
@keyframes bump { 30% { transform: scale(1.08); } }
.ticker { height: 22px; margin-top: 6px; font-size: 14px; color: var(--ink-dim); overflow: hidden; }
.tick { display: inline-block; animation: tick .25s ease-out; }
@keyframes tick { from { transform: translateY(12px); opacity: 0; } }
.people.tight { gap: 8px; padding: 12px 0 4px; }
.person-btn { display: grid; justify-items: center; gap: 2px; min-width: 64px; min-height: 84px; padding: 6px 4px; border-radius: 14px; border: 1.5px solid transparent; background: none; }
.person-btn:hover, .person-btn:focus-visible { border-color: var(--line); background: var(--night-2); }
.person-btn .chip { width: 44px; height: 44px; font-size: 18px; border-color: var(--night); }
.person-btn.me .chip { box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--amber); }
.person-btn .pn { font-size: 14px; font-weight: 600; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-btn .pa { font-size: 13px; color: var(--ink-dim); }
.pick-title { margin-top: 10px; }
.hint { color: var(--ink-dim); font-size: 14px; text-align: center; margin: -6px 0 4px; }
.empty { text-align: center; color: var(--paper-dim); padding: 22px 8px; margin: 0; font-size: 17px; }
.empty.dark { color: var(--ink-dim); }
.more { width: 44px; min-height: 52px; border: 0; background: none; color: var(--paper-dim); font-size: 24px; font-weight: 800; border-radius: 10px; }
.more:hover { background: rgba(0,0,0,.06); }
.item-main.static { cursor: default; }
.unit { transition: transform .12s, background-color .15s; }
.unit:active, .item-main:active { transform: scale(.97); }
.unit.just { animation: press .22s ease-out; }
.free-t { color: #a3243f; }
.item.flash { animation: flash .7s ease-out; }
@keyframes flash { 0% { background-color: rgba(255,178,36,.55); } 100% { background-color: transparent; } }
.chip.pop { animation: pop .26s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(0); } }
.chip.more-n { background: #1b1622; color: var(--paper); font-size: 12px; }

.nudge { display: grid; gap: 10px; padding: 14px 16px; margin: 4px 0 12px; border-radius: 16px; background: rgba(255,92,122,.1); border: 1.5px dashed var(--coral); animation: tick .25s ease-out; }
.nudge strong { font-size: 18px; }
.nudge .small { color: #ffc2cf; }
.nudge-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; min-width: 48px; padding: 6px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--night-2); color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; }
.mini-btn.amber { background: var(--amber); color: #1b1100; border-color: var(--amber); }
.mini-btn.mint { background: var(--mint); color: #062a22; border-color: var(--mint); }
.mini-btn.ghost { background: transparent; }

/* bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(5,3,9,.6); z-index: 30; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; inset: auto 0 0 0; max-width: 480px; margin: 0 auto; max-height: 86dvh; overflow: auto; z-index: 31; background: var(--night-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s cubic-bezier(.2,.9,.3,1); box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 22px; }
.sheet-head .mono { font-size: 20px; color: var(--amber); }
.seg-units { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.seg-units button { min-height: 48px; min-width: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--night); font-family: var(--mono); font-weight: 700; padding: 4px 12px; }
.seg-units button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.who-btn { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--night); font-weight: 600; text-align: start; }
.who-btn .chip { border-color: var(--night); }
.who-btn[aria-pressed="true"] { border-color: var(--amber); background: rgba(255,178,36,.12); }
.edit-box { margin-top: 14px; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 14px 12px; }
.edit-box summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.edit-grid { display: grid; grid-template-columns: 1fr 80px 104px; gap: 8px; margin-bottom: 10px; }
.edit-grid label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-dim); }
.edit-grid .input { min-height: 50px; font-size: 17px; padding: 8px 10px; }
.btn-danger { background: transparent; border: 2px solid var(--coral); color: #ffb3c2; }
.plist { list-style: none; padding: 0; margin: 14px 0; }
.plist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
body.sheet-open { overflow: hidden; }

/* summary */
.tag { font-weight: 600; font-size: 13px; background: #1b1622; color: var(--paper); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.paybar { height: 8px; border-radius: 5px; background: var(--night-3); overflow: hidden; margin-top: 10px; }
.paybar i { display: block; height: 100%; background: var(--mint); transition: width .3s; }
.debtor { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.debtor .chip { border-color: var(--night-2); }
.debtor .dn { display: grid; }
.debtor .dn .mono { color: var(--ink-dim); font-size: 15px; direction: ltr; text-align: right; }
.debtor.is-paid .dn strong { text-decoration: line-through; text-decoration-color: var(--mint); text-decoration-thickness: 2px; }

/* undo snackbar */
.snack { position: fixed; inset-inline: 18px; bottom: calc(118px + env(safe-area-inset-bottom)); max-width: 444px; margin: 0 auto; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--ink); color: var(--night); padding: 6px 6px 6px 6px; padding-inline-start: 16px; border-radius: 14px; font-weight: 600; font-size: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: tick .18s ease-out; }
.snack span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snack button { min-height: 44px; padding: 6px 16px; border-radius: 10px; border: 0; background: var(--night); color: var(--amber); font-weight: 800; flex: none; }

/* celebration */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; display: grid; place-items: center; overflow: hidden; }
.fx i { position: absolute; top: -12px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; animation: fall 1.1s cubic-bezier(.2,.6,.4,1) var(--d) forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(var(--r)); opacity: .2; } }
.stamp { font-weight: 800; font-size: 34px; color: var(--mint); border: 5px solid var(--mint); border-radius: 16px; padding: 10px 22px; transform: rotate(-8deg); background: rgba(14,11,20,.85); text-shadow: 0 0 18px rgba(92,225,198,.6); box-shadow: 0 0 40px rgba(92,225,198,.35); animation: stamp .26s cubic-bezier(.3,1.5,.5,1) both, out .3s ease-in 1.9s forwards; }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.8); opacity: 0; } }
@keyframes out { to { opacity: 0; transform: rotate(-8deg) scale(.95); } }

.loading { padding-top: 12vh; }
.skel.short { width: 50%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .pline { opacity: 1; }
}
