/* #256 one-page customer home. Loaded last: the customer view has no tab bar, a tidy header, and one clear order:
   what you have (cards), how to use it (QR), how to save (pack and subscription priced per coffee). */

/* Header: lockup on the left, language and account on the right, one row, no tabs. */
body[data-role=customer] header #nav{display:none!important}

/* Page rhythm: one column, generous gaps between the three jobs. */
body[data-role=customer][data-route=home] main{width:100%;min-width:0;max-width:520px;margin-left:auto!important;margin-right:auto!important;padding:0 20px;overflow-x:clip}
body[data-role=customer][data-route=home] .customer-page-template{padding:0}

/* How to use it: the QR bar is the page's one primary action, with one quiet line under it. */
body[data-route=home] .customer-page-template .show-card{width:100%;margin-top:18px;min-height:64px;padding:0 20px 0 18px;grid-template-columns:30px 1px 1fr 30px;gap:14px}
body[data-route=home] .customer-page-template .show-card .arrow{justify-self:end;font-size:1.375rem}

.first-stamp-hint{
 padding:0 4px;
 color:var(--cc-ink);
 font:500 0.875rem/1.4 var(--cc-font-body);
 text-wrap:pretty;
}
@media(max-width:480px){
 body[data-role=customer] .home-v2:has(.first-stamp-hint){--v2-s2:12px}
 body[data-role=customer] .home-v2:has(.first-stamp-hint){
  & .home-v2-tile{min-height:130px;padding-block:10px 8px}
  & .home-v2-num{font-size:2.125rem}
  & .home-v2-label{min-height:calc(2 * 1.2em)}
  & .smart-banner{padding-block:8px}
 }
 html body[data-role=customer][data-route=home] .home-v2:has(.first-stamp-hint) .home-v2-pair .show-card{min-height:52px}
}

/* Subscriber: this week's coffees as cups, the renewal date, and cancel kept quiet. */
.home-week-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}
.home-week-foot p{margin:0;font:600 0.875rem/1.3 var(--cc-font-body);color:var(--cc-ink)}
.home-week-foot .text-btn{padding:0;min-width:0;color:var(--cc-brown-muted);font-size:0.78125rem;white-space:nowrap}
.home-week-note{margin:16px 0 0}

/* Offers are a single price comparison with one action. */
.home-save{margin:40px 0 0}
.home-save h2{margin:0;font:400 1.6875rem/1.1 "Lilita One",var(--cc-font-display);color:var(--ink)}
.offers-comparison{margin:4px 0 14px;color:var(--soft);font-size:0.875rem}
.home-offer-list{
 --offer-list-radius:16px;
 --offer-list-border:1px;
 --offer-row-radius:calc(var(--offer-list-radius) - var(--offer-list-border));
 overflow:hidden;border:var(--offer-list-border) solid #ddcabb;border-radius:var(--offer-list-radius);background:#fffaf3
}
.home-save .offer-row{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:61px;margin:0;padding:9px 12px;color:var(--ink);cursor:pointer}
.home-offer-list .offer-row+.offer-row{border-top:1px solid #e7d8cb}
.home-offer-list .offer-row:first-child{border-start-start-radius:var(--offer-row-radius);border-start-end-radius:var(--offer-row-radius)}
.home-offer-list .offer-row:last-child{border-end-start-radius:var(--offer-row-radius);border-end-end-radius:var(--offer-row-radius)}
.home-offer-list .offer-row:has(> input[type=radio]:checked){background:var(--ds-sun-soft,#fbe3a6);box-shadow:inset 0 0 0 2px var(--ds-ink,#2b1d12)}
.home-offer-list .offer-row:has(> input[type=radio]:focus-visible){outline:2px solid #a32120;outline-offset:-3px}
.offer-medal{width:15px;height:15px;border-radius:50%;background:radial-gradient(circle at 33% 28%,#fff 0,var(--tier-metal,#c1b6ab) 60%,#766558 100%)}
.offer-copy,.offer-price{display:grid;gap:2px}
.offer-copy strong,.offer-price{font:800 0.9375rem/1.2 var(--cc-font-body)}
.offer-row small{font:600 0.75rem/1.25 var(--cc-font-body);color:var(--soft)}
.offer-price{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.offer-price small{color:#246341}
.offer-buy{display:block;width:100%;min-height:48px;margin-top:12px;padding:8px 12px;border:0;border-radius:15px;background:#a32120;color:#fffaf3;font:800 1rem/1.2 var(--cc-font-body);cursor:pointer}
.offer-buy:active:not(:disabled){background:#831918}
.offer-buy:disabled,.offer-btn-counter[aria-disabled=true]{opacity:.55;cursor:not-allowed}
.offer-btn-counter{display:flex;width:100%;margin-top:12px;border:0;background:none;text-decoration:underline;cursor:pointer;align-items:center;justify-content:center;min-height:44px;color:#8e2520;font:700 0.875rem/1.25 var(--cc-font-body);text-align:center;text-underline-offset:3px}
.offer-btn-counter[hidden]{display:none}


/* The demo's extra role strip takes first-viewport space above My card. */
@media(max-width:480px){
 body[data-role=customer][data-route=home]:has(.demo-banner) .home-v2{--v2-s2:8px}
}

/* The packs sheet: opened from the card, over this page. */
.pack-sheet h2{margin:0;font:400 1.625rem/1.1 "Lilita One",var(--cc-font-display)}
.pack-sheet>.sub{margin:6px 0 16px}
.sheet-packs{display:grid;gap:10px;margin:0 0 14px}
.sheet-pack{display:grid;grid-template-columns:52px 1fr auto;align-items:center;gap:12px;width:100%;min-height:76px;padding:10px 16px 10px 10px;border-radius:20px;text-align:left;cursor:pointer;transition:transform .14s}
.sheet-pack:active{transform:scale(.98)}
.sheet-pack .offer-count{display:grid;place-content:center;justify-items:center;width:52px;height:52px;border-radius:50%;background:rgba(255,255,255,.55);box-shadow:inset 0 0 0 1.5px var(--tier-edge);color:var(--tier-ink)}
.sheet-pack .offer-count b{font:400 1.3125rem/.9 "Lilita One",var(--cc-font-display)}
.sheet-pack .offer-count small{margin-top:2px;font:700 0.4375rem/1 var(--cc-font-body);letter-spacing:.06em;text-transform:uppercase}
.sheet-pack-copy>span{color:var(--tier-sub)}
.sheet-pack-copy{display:grid;gap:3px;min-width:0}
.sheet-pack-copy strong{font:700 1rem/1.2 var(--cc-font-body)}
.sheet-pack-copy span{font:500 0.84375rem/1.3 var(--cc-font-body);opacity:.85}
.sheet-pack-price{font:400 1.5rem/1 "Lilita One",var(--cc-font-display)}
@media (prefers-reduced-motion:reduce){.sheet-pack{transition:none}.sheet-pack:active{transform:none}}

/* Recent visits and plan details stay on the page, folded away. */
.home-more{margin:28px 0 8px;border-top:1px solid var(--cc-divider)}
.home-fold{border-bottom:1px solid var(--cc-divider)}
.home-help{margin:16px 0 0;font-size:0.875rem;line-height:1.4;color:var(--cc-brown-muted)}.home-help a{color:var(--cc-ink);overflow-wrap:anywhere}
/* #284: the live smoke keeps 12px between tap targets, so the two folds sit apart rather than touching. */
.home-fold+.home-fold{margin-top:12px}
.home-fold>summary{display:flex;align-items:center;justify-content:space-between;min-height:52px;cursor:pointer;list-style:none;font:600 0.9375rem/1.2 var(--cc-font-body);color:var(--cc-ink)}
.home-fold>summary::-webkit-details-marker{display:none}
.home-fold>summary:after{content:'';width:8px;height:8px;margin-right:4px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-3px);transition:transform .2s}
.home-fold[open]>summary:after{transform:rotate(-135deg) translateY(-2px)}
.home-fold-body{padding:0 0 14px;font-size:0.875rem;color:var(--cc-pencil)}
.home-fold-body p{margin:0 0 8px;line-height:1.5}
.home-fold-body .text-btn{padding:0;font-weight:600}

@media (prefers-reduced-motion:reduce){.home-fold>summary:after{transition:none}}

/* #256 build: the bottom bar, two places on this one page. Thumb-height, above the home indicator, never over the footer. */
/* Josh (31 Oct 2026): the bar is pinned flush to the bottom edge, full width on a solid strip, and the page keeps room for
   it underneath, so it never floats over the offers or the last lines. The pill inside keeps its look. */
.home-dock{position:fixed;z-index:30;left:50%;bottom:calc(10px + env(safe-area-inset-bottom));transform:translateX(-50%);display:grid;grid-template-columns:1fr 1fr;width:min(320px,calc(100vw - 40px));padding:5px;border:1.5px solid var(--ink-line);border-radius:999px;background:rgba(255,250,240,.94);box-shadow:0 3px 0 var(--ink-line),0 14px 30px -14px rgba(46,31,22,.5);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.home-dock a{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;border-radius:999px;color:var(--cc-ink);font:700 0.90625rem/1 var(--cc-font-body);text-decoration:none;transition:background-color .2s,color .2s}
.home-dock svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.home-dock a[aria-current]{background:var(--ink-line);color:#FFF8EC}
.home-dock a:focus-visible{outline:3px solid var(--sun,#F2B33D);outline-offset:2px}
body[data-role=customer][data-route=home]:has(.home-dock)::after{content:"";position:fixed;z-index:29;left:0;right:0;bottom:0;height:calc(78px + env(safe-area-inset-bottom));border-top:1px solid var(--cc-divider,#DCC9A8);background:var(--cc-paper,#F7F0E2);pointer-events:none}
@media (prefers-reduced-motion:reduce){.home-dock a{transition:none}}

/* An active weekly subscriber: the gold frame, and a holographic foil that drifts across the card now and then. */
.club-card.is-subscriber::after{content:"";position:absolute;inset:2cqw;z-index:1;pointer-events:none;border-radius:2.8cqw;padding:.7cqw;background:linear-gradient(118deg,#f8e7b0 0%,#c8963e 28%,#fbeab8 50%,#b8862f 74%,#ecd08a 100%);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}

/* One status line under the packs: its tone says what happened before the words do (text ≥ 4.5:1 on each tint). */
.counter-status{display:flex;align-items:center;gap:12px;margin:12px 0 0;padding:14px 16px;border:2px solid var(--ink-line);border-radius:18px;background:#FFF9EF;color:#2E1F16;font:600 0.9375rem/1.35 var(--cc-font-body);overflow-wrap:anywhere}
.counter-status[hidden]{display:none}
.counter-status::before{content:"";flex:none;width:22px;height:22px;border-radius:50%;background:center/14px no-repeat}
.counter-status[data-state=pending]::before{border:3px solid rgba(46,31,22,.18);border-top-color:#2E1F16}
.counter-status[data-state=accepted]{border-color:#1F6B45;background:#E3F1E6;color:#124029}
.counter-status[data-state=accepted]::before{background-color:#1F6B45;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.counter-status[data-state=declined],.counter-status[data-state=expired],.counter-status[data-state=error]{border-color:var(--oops,#A3271B);background:#FBE9E5;color:#7A1C13}
.counter-status[data-state=declined]::before,.counter-status[data-state=expired]::before,.counter-status[data-state=error]::before{background-color:var(--oops,#A3271B);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5v5.5' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='12.3' r='1.4' fill='%23fff'/%3E%3C/svg%3E")}
.counter-status[data-state=offline]{border-style:dashed;background:#F3E9D8;color:#4A3424}
.counter-status[data-state=offline]::before{border:3px solid #7A5A42;background:none}
@media (prefers-reduced-motion:no-preference){
 .counter-status:not([hidden]){animation:counter-status-in .2s cubic-bezier(.23,1,.32,1)}
 .counter-status[data-state=pending]::before{animation:counter-status-spin .8s linear infinite}
}
@keyframes counter-status-in{from{opacity:0;transform:translateY(4px) scale(.98)}}
@keyframes counter-status-spin{to{transform:rotate(360deg)}}

/* The QR label follows enlarged text without imposing its intrinsic width on the grid. */
body[data-route=home] .customer-page-template .show-card { grid-template-columns:30px 1px minmax(0,1fr) 30px; padding-top:10px; padding-bottom:10px; }
body[data-route=home] .customer-page-template .show-card > span:nth-last-child(2) { white-space:normal; overflow-wrap:anywhere; line-height:1.2; }
