/* Design tokens lifted from the Cash Loop prototype (style.css / .cl rules).
   Styling only: no behaviour changes. Loaded after style.css. */
/* colours: public/theme.css owns every one of them; only the radii belong here */
/* colours: public/theme.css owns every one of them */
body{background:var(--bg);color:var(--white);line-height:1.6}
.card{background:var(--s1);color:var(--white);border:1px solid var(--s3);border-radius:var(--r-row);padding:12px}
.card .sub,.sub{color:var(--mut);font-size:12px;line-height:1.6}
.card b{font-size:15px;font-weight:700}
.hero{background:linear-gradient(135deg,var(--deep),var(--deep2));border-radius:var(--r-card);padding:20px;color:var(--white)}
.hero small{color:var(--tint);font-size:13px;opacity:.9}
.hero b{font-size:36px;font-weight:800;line-height:1.15;margin:4px 0 10px}
.emoji{width:50px;height:50px;border-radius:var(--r-ic);background:var(--s2);font-size:26px}
.row .emoji{width:54px;height:54px}
.tag{background:var(--c56);color:var(--red);border-radius:10px;padding:5px 9px;font-size:12px;font-weight:700}
.btn{border-radius:var(--r-row);padding:15px 18px;font-size:16px;font-weight:800}
.btn.sm{border-radius:10px;padding:8px 12px;font-size:13px}
h2{font-size:17px;font-weight:700;margin:22px 16px 12px}
h3{font-size:17px;font-weight:700}
/* the navigation is navy and opaque: a translucent bar picked up the colour of whatever card was
   behind it and read maroon over the wallet */
.tabs{background:var(--s1);border-top:1px solid var(--s3)}
.tabs a{font-size:11px;color:var(--dim)}
.tabs a span{font-size:22px}
.tabs a.on{color:var(--red)}
.cartbar{border-radius:var(--r-row);background:linear-gradient(135deg,var(--pink),var(--red));color:var(--white);font-weight:800}
.chip{border-radius:16px;padding:8px 12px;font-size:13px}
.search{border-radius:14px;padding:10px 14px;font-size:13px;background:var(--s1);border:1px solid var(--s3);color:var(--white)}
.drawer{border-start-start-radius:var(--r-card);border-start-end-radius:var(--r-card);background:var(--s1)}
/* home screen, mirroring the prototype's .cl-top / .cl-hi / .cl-name / .cl-card / .cl-cats / .cl-stores */
.p-top{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 6px}
.p-logo{font-size:19px;font-weight:800;direction:ltr;color:var(--white);letter-spacing:.2px}
.p-logo span{color:var(--red)}
.p-mark{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--deep),var(--red));display:grid;place-items:center;color:var(--white);font:800 15px/1 system-ui;direction:ltr}
.p-hi{font-size:14px;color:var(--mut);padding:0 16px}
.p-name{font-size:22px;font-weight:700;padding:2px 16px 6px}
.p-city{font-size:13px;color:var(--c60);padding:0 16px 14px;font-weight:600}
.p-mic{display:flex;align-items:center;gap:12px;margin:0 16px 12px;padding:14px;border-radius:18px;background:var(--s1);border:1px dashed var(--c62);text-decoration:none;color:var(--white)}
.p-mic b{display:block;font-size:14px;font-weight:700}.p-mic span{font-size:12px;color:var(--mut);line-height:1.6}
.p-mic i{width:52px;height:52px;border-radius:50%;background:var(--red);display:grid;place-items:center;font-size:24px;flex:none;font-style:normal}
.p-card{background:linear-gradient(135deg,var(--deep),var(--deep2));border-radius:24px;padding:20px;margin:0 16px 6px;position:relative;overflow:hidden}
.p-card:after{content:"";position:absolute;width:180px;height:180px;border-radius:50%;border:30px solid var(--c85);inset-inline-end:-50px;top:-60px}
.p-card small{font-size:13px;opacity:.9;color:var(--white)}
.p-bal{font-size:36px;font-weight:800;margin:4px 0 14px}
.p-row{display:flex;gap:10px}
.p-pill{background:var(--c12);color:var(--tint);border-radius:14px;padding:10px 14px;font-size:13px;font-weight:600;flex:1;text-align:center;text-decoration:none}
.p-pill.l{background:var(--c87);color:var(--deep2)}
.p-sec{display:flex;justify-content:space-between;align-items:center;margin:22px 16px 12px}
.p-sec h3{font-size:17px;margin:0}
.p-clear{background:none;border:0;color:var(--red);font-size:13px}
.p-cats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:0 16px}
.p-cat{background:var(--s1);border-radius:16px;padding:10px 2px;text-align:center;font-size:11px;border:1px solid var(--s3);color:var(--white)}
.p-cat.on{border-color:var(--red)}
.p-cat div{font-size:24px;margin-bottom:4px}
.p-cat em{display:block;font-style:normal;color:var(--cash-ink);font-weight:700;margin-top:2px;font-size:11px}
.p-search{margin:14px 16px 0;width:calc(100% - 32px)}
.p-store{display:flex;align-items:center;gap:12px;background:var(--s1);border:1px solid var(--s3);border-radius:18px;padding:12px;margin:0 16px 10px;text-decoration:none;color:var(--white)}
.p-ic{width:50px;height:50px;border-radius:15px;background:var(--s2);display:grid;place-items:center;font-size:26px;flex:none}
.p-store b{display:block;font-size:15px}.p-store span{font-size:12px;color:var(--mut)}
.p-tag{margin-inline-start:auto;background:var(--cash-tint);color:var(--cash-ink);border:1px solid var(--cash-line);border-radius:10px;padding:4px 9px;font-size:12px;font-weight:700;white-space:nowrap}
.p-banner{display:flex;align-items:center;gap:12px;margin:14px 16px 0;padding:14px;border-radius:18px;background:var(--s1);border:1px dashed var(--c62);text-decoration:none;color:var(--white)}
.p-banner b{display:block;font-size:14px}.p-banner span{font-size:12px;color:var(--mut)}
.p-hi{display:flex;align-items:center;gap:8px;padding-top:6px}
.hlogo{display:flex;align-items:center;gap:9px}
/* prototype: sector tiles are cream cards with dark text and a crimson rate */
.p-cat{background:var(--cream);color:var(--s1);border:1px solid var(--creamb);font-weight:600}
.p-cat em{color:var(--c3)}
.p-cat.on{border-color:var(--red);box-shadow:0 0 0 2px var(--c60)}
/* wallet card pills: solid and crisp, no inherited transparency */
.p-pill{display:block;background:var(--c12);color:var(--tint);text-decoration:none;opacity:1;font-weight:600;border:1px solid var(--c81)}
.p-pill.l{background:var(--white);color:var(--deep2);border-color:var(--white)}
/* crisp pills: solid fills, no translucency over the card gradient */
.p-row .p-pill{background:var(--c7) !important;color:var(--tint) !important;border:0;opacity:1;mix-blend-mode:normal}
.p-row .p-pill.l{background:var(--white) !important;color:var(--deep2) !important}
.p-card>*{position:relative;z-index:1}
/* hands-free voice screen */
.v2-state{background:var(--s1);border:1px solid var(--s3);border-radius:14px;padding:10px 14px;font-size:13px;color:var(--mut);margin:0 0 10px}
.v2-state.on{border-color:var(--red);color:var(--red)}
.v2-log{display:flex;flex-direction:column;gap:10px;margin-bottom:12px;max-height:46vh;overflow-y:auto;
  -webkit-overflow-scrolling:touch;scroll-behavior:smooth;padding:10px 12px;border:1px solid var(--c17);border-radius:16px;background:var(--c10);
  -webkit-mask-image:linear-gradient(to bottom,transparent,var(--black) 12px,var(--black) 100%);
  mask-image:linear-gradient(to bottom,transparent,var(--black) 12px,var(--black) 100%)}
.v2-log:empty{display:none}
@media (max-height:700px){.v2-log{max-height:28vh}}
.v2-note{text-align:center;margin:10px 0 calc(96px + env(safe-area-inset-bottom))}
/* the docked invoice: one summary line, the rows behind a tap, never under the cart bar */
.invcard{padding:0;overflow:hidden}
.invsum{display:flex;align-items:center;gap:10px;width:100%;background:none;border:0;color:var(--white);padding:13px 14px;font:inherit;font-size:14.5px;font-weight:700;cursor:pointer;text-align:start}
.invsum .ivn{color:var(--mut);font-weight:600;font-size:13px;display:flex;flex-direction:column;line-height:1.35}
.invsum .ivl{white-space:nowrap}
.invsum .ivtot{margin-inline-start:auto;color:var(--pink);font-weight:800}
.invsum .ivchev{color:var(--mut);font-size:11px}
/* the lines carry photos now, so the opened invoice runs in the page instead of hiding items in a
   short scroll box: nothing in the basket is ever out of sight behind a cap */
.invbody{overflow:visible;padding:0 14px 12px;border-top:1px solid var(--c17)}
.truncnote{margin:8px 16px 4px;color:var(--mut)}

/* Cashback is the green thing on every list: the store row, the sector tile, the store header, the product
   card. Green is reserved for money coming back, so it never means anything else. A store that gives none
   gets a quiet grey note instead of a green one shouting zero. */
.cb{display:inline-flex;align-items:center;gap:3px;background:var(--cash-tint);color:var(--cash-ink);border:1px solid var(--cash-line);
  border-radius:10px;padding:1px 8px;font-size:11.5px;font-weight:700;white-space:nowrap;line-height:1.7}
.cb.none{background:transparent;border-color:var(--white-16);color:var(--white-45);font-weight:600}
.cb.amount{background:var(--cash-tint-2);font-size:12px}
.p-store .cb{margin-inline-start:auto}
.p-cat .cb{display:block;margin:2px auto 0;font-size:10.5px;padding:0 4px}

/* Weighed goods: the control is a weight, not a count. Quarter kilo per tap, exact weight typed in. */
.qty.w{gap:4px}
.qty.w .wqin{width:56px;text-align:center;font:inherit;font-weight:700;color:var(--maroon,var(--c19));
  border:1px solid var(--hair-strong);border-radius:9px;padding:4px 2px;background:var(--white)}
.qty.w .wqin:focus{outline:none;border-color:var(--crimson,var(--c47));box-shadow:0 0 0 3px var(--crimson-focus)}
.qty.w .wunit{font-size:11px;color:var(--c26);margin-inline-start:2px}
.perk{font-size:11px;color:var(--c26);font-weight:500}
.wline{color:var(--c26);font-size:12px;margin-inline-start:2px;white-space:nowrap}

/* Product cards in the conversation: the shelf he picks from, not a list of words. */
.sugrow{display:flex;flex:0 0 auto;gap:10px;overflow-x:auto;padding:8px 0 12px;scroll-padding-inline-start:0;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.sugrow::-webkit-scrollbar{height:0}
.sugcard{flex:0 0 140px;scroll-snap-align:start;background:var(--white);border:1px solid var(--ink-10);border-radius:14px;
  padding:8px;display:flex;flex-direction:column;gap:6px;box-shadow:0 2px 8px var(--ink-06)}
.sugimg{position:relative;height:84px;border-radius:10px;background:var(--c72);display:grid;place-items:center;overflow:hidden}
.sugimg img{width:100%;height:100%;object-fit:contain}
.sugimg.noimg::after{content:'🛍️';font-size:30px;opacity:.45}
.sugph{font-size:30px;opacity:.45}
.sugname{font-size:12.5px;line-height:1.35;color:var(--c19);font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:34px}
.sugfoot{display:flex;align-items:center;gap:6px;justify-content:space-between;flex-wrap:wrap}
.sugfoot b{font-size:13px;color:var(--c19)}
.sugfoot .cb.amount{font-size:11px;padding:1px 7px}
.sugadd{border:0;border-radius:9px;background:var(--crimson,var(--c47));color:var(--white);font:inherit;font-weight:700;font-size:12.5px;padding:7px 0;cursor:pointer}
.sugadd:active{transform:scale(.98)}

/* Cards arrive, they do not pop: opacity and transform only, so the row composites on the GPU and
   never forces layout. 220ms, 45ms apart, and only for a card he has not seen before. */
@keyframes sugIn{from{opacity:0;transform:translate3d(0,12px,0) scale(.97)}to{opacity:1;transform:none}}
.sugcard.in{animation:sugIn 220ms cubic-bezier(.22,.68,.25,1) both}
@keyframes sugPress{0%{transform:scale(1)}55%{transform:scale(.965)}100%{transform:scale(1)}}
.sugcard.adding{animation:sugPress 160ms ease-out both}
.sugcard.added{border-color:var(--ok-line);box-shadow:0 0 0 2px var(--ok-tint)}
.sugadd:disabled{background:var(--c5)}
@media (prefers-reduced-motion: reduce){.sugcard.in,.sugcard.adding{animation:none}}

/* An answer is read, not decoded: the lines the server lays out stay as lines. */
.cl-msg{white-space:pre-line;word-break:break-word}
.cl-msg.bot{line-height:1.65}

/* A reply is a list, not a paragraph: the name holds the right edge, the money holds the left. */
.cl-lead{font-weight:600;margin-bottom:8px}
.cl-items{display:flex;flex-direction:column;gap:2px;margin:2px 0}
.cl-item{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:5px 0;border-bottom:1px solid var(--white-06)}
.cl-item:last-child{border-bottom:0}
.cl-iname{flex:1 1 auto;min-width:0;line-height:1.4}
.cl-iqty{font-style:normal;opacity:.6;font-size:11.5px;margin-inline-start:6px;white-space:nowrap}
.cl-iside{flex:0 0 auto;display:flex;align-items:baseline;gap:6px;white-space:nowrap}
.cl-iside b{font-weight:700}
.cl-icb{color:var(--c16);background:var(--mint-tint);border-radius:8px;padding:1px 6px;font-size:11.5px;font-weight:700}
.cl-note{white-space:pre-line;margin-top:8px;opacity:.92}
.cl-ask{margin-top:12px;font-weight:600}

/* the row starts at its own leading edge: the first card is whole on arrival, not half off the screen */
.sugrow{scroll-snap-type:x proximity;scroll-behavior:auto}
.sugcard{scroll-snap-align:start;scroll-margin-inline-start:0}
.sugrow::after{content:'';flex:0 0 2px}

.cl-iname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.card.hl{border:1.5px solid var(--line,var(--c17))}
.hlgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0}
.hlgrid>div{background:var(--white-04);border-radius:12px;padding:8px 10px}
.hlv{font-size:20px;font-weight:800;margin:2px 0}
@media(max-width:420px){.hlgrid{grid-template-columns:1fr 1fr}}

/* ---- bigger product cards on a phone: he said the boxes read as too small ---- */
@media (max-width: 430px) {
  #app .card.row { padding: 16px 14px; margin: 12px 12px; border-radius: 18px; align-items: flex-start; }
  #app .card.row .row, #app .card.row { gap: 14px; }
  #app .card.row .emoji, #app .row .emoji { width: 88px; height: 88px; border-radius: 16px; font-size: 38px; }
  #app .card.row .nm { font-size: 18px; line-height: 1.5; }
  #app .card.row .nm-en { font-size: 12.5px; }
  #app .card.row .sub { font-size: 14.5px; }
  #app .card.row .sub b { font-size: 19px; }
  #app .card.row .qty { gap: 12px; }
  #app .card.row .qty button { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
  #app .card.row .qty .qn { font-size: 18px; }
  #app .card.prodvar .row .emoji { width: 88px; height: 88px; }
  #app .card.srv .emoji { width: 88px; height: 88px; }
  /* A big card is only big if the words fit: the weight control was 196px wide on a 390px phone and left
     the product name 24px, so every word sat on its own line. The text column keeps its room now. */
  #app .card.row .grow { min-width: 0; flex: 1 1 auto; }
  #app .card.row .emoji, #app .row .emoji { width: 72px; height: 72px; font-size: 32px; }
  #app .card.row .qty.w { max-width: 132px; flex: 0 0 auto; }
  #app .card.row .qty.w .wqin { width: 44px; }
  #app .card.row .qty.w button { width: 36px; height: 36px; font-size: 18px; }
}
