/* owns: loy-r- (Tests/Loyalty/LoyaltyCenterPortalTests reads this line - every rule here leads with it, and no other stylesheet
   styles it).
   THE LOYALTY CENTER'S REDEMPTION PAGES (docs/claude/LOYALTY.md 5.4) - the register desk (/loyalty/redeem: the store, the one look-up
   field, the member, what they hold, the check and the redeem, the receipt with Undo, today at this store), the redemption ledger
   (/loyalty/redemptions: the window of days, the filters, the table, the pager) and one redemption (/loyalty/redemptions/{id}), and
   their components (Components/Loyalty/Redemptions - the facts and the undo). This stylesheet owns every loy-r-* class;
   loyalty-center.css owns the rest of loy-* (the frame, cards, fields, notes, the table's stacking - reused here, never restyled).
   A token-only door, whole (Tests/ShellTokensOnlyTests): colours are --theme-* / --wf-* tokens only, so light, dark and every tenant
   theme read the same. Built for a tablet at a counter: 44px targets on a coarse pointer, nothing scrolls sideways at 320px. */

/* ---- The desk ---- */
.loy-r-desk { display: grid; gap: 16px; min-width: 0; }
.loy-r-wallet, .loy-r-today { min-width: 0; }
/* The phone till (LoyaltyPhoneTillLink - LOYALTY.md 5.6): its QR beside the link. */
.loy-r-phone { display: flex; flex-direction: row; align-items: center; gap: 16px; }
.loy-r-phone-qr { width: 112px; height: 112px; flex-shrink: 0; }
.loy-r-phone-qr svg { display: block; width: 100%; height: 100%; }
.loy-r-phone-link { display: inline-flex; align-items: center; gap: 8px; color: var(--wf-primary-ink); font-weight: 600; }
.loy-r-scan { gap: 14px; }
.loy-r-where { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.loy-r-where-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.loy-r-inline-label { color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
.loy-r-select { width: auto; max-width: 18rem; min-width: 0; }
.loy-r-at { display: inline-flex; align-items: center; gap: 6px; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 600; }
.loy-r-at i { color: var(--wf-primary-ink); }

/* The one look-up field - big, calm, scanner-friendly. */
.loy-r-lookup { display: grid; gap: 6px; margin: 0; }
.loy-r-lookup-row { position: relative; display: flex; gap: 8px; align-items: stretch; min-width: 0; }
/* Anchored to the input's own 48px height, never 50% of the row - on a phone the row wraps and the button takes a line of its own. */
.loy-r-lookup-icon { position: absolute; left: 14px; top: 24px; transform: translateY(-50%); color: var(--theme-text-secondary); font-size: 18px; pointer-events: none; }
.loy-r-lookup-input { flex: 1 1 auto; min-width: 0; height: 48px; padding-left: 44px; font-size: 16px; }
.loy-r-lookup-row .btn { min-height: 48px; padding-inline: 20px; }
.loy-r-readas { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; overflow-wrap: anywhere; }
/* "Looking up SAVE5-7QK2..." - while a look-up runs, in the theme's own ink so the clerk sees the scan was taken. */
.loy-r-looking { display: flex; align-items: center; gap: 8px; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 600; }
.loy-r-alts { display: flex; flex-wrap: wrap; gap: 4px 8px; }

/* The member. */
.loy-r-member { gap: 12px; }
.loy-r-member-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.loy-r-member-main { flex: 1 1 auto; min-width: 0; }
.loy-r-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--wf-radius-pill); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 18px; font-weight: 650; }
.loy-r-member-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 8px 16px; margin: 0; }
.loy-r-member-facts dt { color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; }
.loy-r-member-facts dd { margin: 2px 0 0; color: var(--theme-text-emphasis); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.loy-r-trimmed { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }

/* What they hold. */
.loy-r-items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.loy-r-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--wf-line); }
.loy-r-item:first-child { border-top: 0; }
.loy-r-item-main { min-width: 0; }
.loy-r-item-main p { margin: 0; overflow-wrap: anywhere; }
.loy-r-item-why { margin-top: 2px; color: var(--wf-warning-ink); font-size: 12.5px; }

/* Using one thing: the verdict, the basket, redeem. */
.loy-r-use { gap: 14px; }
.loy-r-eyebrow { margin: 0 0 2px; color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; }
.loy-r-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.loy-r-discount { color: var(--theme-text-emphasis); font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.loy-r-reasons { display: grid; gap: 4px; margin: 0; padding-left: 20px; color: var(--theme-text-emphasis); font-size: 13.5px; }
.loy-r-next { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.loy-r-next i { color: var(--wf-primary-ink); }
.loy-r-checkout { display: grid; gap: 12px; margin: 0; }
.loy-r-checkout-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 12px 16px; }
.loy-r-amount { font-variant-numeric: tabular-nums; }
/* The usage report's member filter (?member=) and the download's progress line. */
.loy-r-member-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.loy-r-download { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
/* The register's own code - taken in the look-up field, shown here (never typed here: a scan's Enter would act on this card). */
.loy-r-register { display: grid; gap: 4px; align-content: start; min-width: 0; }
.loy-r-register-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--theme-text-emphasis); font-size: 13.5px; }
.loy-r-register-line i { color: var(--wf-success-ink); }
.loy-r-confirm { padding: 10px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-warning-soft); }
.loy-r-checkout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loy-r-checkout-actions .btn-primary { min-width: 9rem; }
.loy-r-mark-open { margin-left: auto; }
.loy-r-mark { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); }
.loy-r-mark-title { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-r-mark-lead { margin: 0; color: var(--theme-text-secondary); font-size: 13px; max-width: 72ch; }

/* The receipt and one redemption's facts. */
.loy-r-receipt { gap: 14px; border-color: var(--wf-success-ink); }
.loy-r-receipt-icon { color: var(--wf-success-ink); margin-right: 4px; }
.loy-r-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 12px 20px; margin: 0; }
.loy-r-fact { min-width: 0; }
.loy-r-fact dt { color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; }
.loy-r-fact dd { display: grid; gap: 2px; margin: 2px 0 0; color: var(--theme-text-emphasis); font-size: 14px; overflow-wrap: anywhere; }
.loy-r-fact-sub { color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-r-fact-wide { grid-column: 1 / -1; }
.loy-r-money { font-variant-numeric: tabular-nums; }
.loy-r-lines { display: grid; gap: 4px; margin: 0; padding-left: 20px; color: var(--theme-text-emphasis); font-size: 13.5px; }
.loy-r-more { margin: 0; font-size: 13px; }
.loy-r-one { gap: 16px; }
.loy-r-key { border-top: 1px solid var(--wf-line); padding-top: 10px; }
.loy-r-key summary { color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.loy-r-key-lead { margin: 6px 0 2px; color: var(--theme-text-secondary); font-size: 12.5px; max-width: 72ch; }
.loy-r-key-value { margin: 0; overflow-wrap: anywhere; }

/* Undo. */
.loy-r-void { display: grid; gap: 10px; border-top: 1px solid var(--wf-line); padding-top: 12px; }
.loy-r-void-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.loy-r-void-when { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-r-void-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-danger-soft); }
.loy-r-void-title { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-r-void-lead { margin: 0; color: var(--theme-text-emphasis); font-size: 13px; max-width: 72ch; }
.loy-r-void-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.loy-r-undone { align-items: flex-start; }
.loy-r-undone-body { display: grid; gap: 2px; }
.loy-r-undone-title { margin: 0; font-weight: 650; }
.loy-r-undone-line { margin: 0; color: var(--theme-text-emphasis); font-size: 13px; }

/* Today at this store. */
.loy-r-today-list { display: grid; margin: 0; padding: 0; list-style: none; }
.loy-r-today-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 10rem) 6.5rem; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--wf-line); font-size: 13.5px; }
.loy-r-today-row:first-child { border-top: 0; }
.loy-r-today-row.is-undone { color: var(--theme-text-secondary); }
.loy-r-today-row.is-undone .loy-r-today-name { text-decoration: line-through; }
.loy-r-today-time { color: var(--theme-text-secondary); font-variant-numeric: tabular-nums; }
.loy-r-today-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loy-r-today-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--theme-text-secondary); }
.loy-r-today-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.loy-r-quiet { margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.loy-r-skel-rows { height: 120px; border-radius: var(--wf-radius-md); }

/* ---- The ledger ---- */
.loy-r-ranges { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.loy-r-days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.loy-r-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.loy-r-filter { width: auto; max-width: 16rem; min-width: 0; }
.loy-r-totals { margin: 0; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 600; }
/* THE TABLE NEVER OUTGROWS ITS CARD (BlazorConventions "The look" - Tables): fixed layout at 100%, the time and amount columns DECLARE
   their widths, the three text columns share the rest and ellipsise (a title holds the whole value), and under 980px of page the
   rows stack into cards (the rule below). The arithmetic - the Center's chrome 280px + declared 10rem + 6.5rem + 3 text columns x
   144px = 976px - is pinned by Tests/Loyalty/LoyaltyRedeemPortalTests. */
.loy-r-table { table-layout: fixed; width: 100%; }
.loy-r-table .loy-r-col-when { width: 10rem; }
.loy-r-table .loy-r-col-amount { width: 6.5rem; text-align: right; }
.loy-r-table .loy-r-col-offer, .loy-r-table .loy-r-col-member, .loy-r-table .loy-r-col-store { text-align: left; }
.loy-r-table td { overflow: hidden; }
.loy-r-table td.loy-r-money { text-align: right; font-weight: 600; }
.loy-r-cell-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loy-r-row-undone td { color: var(--theme-text-secondary); }
.loy-r-row-undone .loy-r-money { text-decoration: line-through; }
.loy-r-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loy-r-pager .loy-table-foot { margin-right: auto; }

/* ---- Narrow sheets and touch ---- */
@container page (max-width: 980px) {
    .loy-r-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .loy-r-table > tbody > tr { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--wf-line); }
    .loy-r-table > tbody > tr > td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; overflow: visible; text-align: left; }
    .loy-r-table > tbody > tr > td::before { content: attr(data-label); flex: 0 0 auto; color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; }
    .loy-r-table > tbody > tr > td:first-child { display: grid; }
    .loy-r-table > tbody > tr > td:first-child::before { content: none; }
    .loy-r-table .loy-r-cell-text { white-space: normal; overflow-wrap: anywhere; }
}

@container page (max-width: 760px) {
    .loy-r-today-row { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
    .loy-r-today-who { display: none; }
}

@container page (max-width: 480px) {
    .loy-r-lookup-row { flex-wrap: wrap; }
    .loy-r-lookup-row .btn { flex: 1 1 100%; }
    .loy-r-item { grid-template-columns: minmax(0, 1fr) auto; }
    .loy-r-item .btn { grid-column: 1 / -1; }
    .loy-r-mark-open { margin-left: 0; }
    .loy-r-select { max-width: 100%; }
}

@media (pointer: coarse) {
    .loy-r-item .btn,
    .loy-r-checkout-actions .btn,
    .loy-r-void-actions .btn { min-height: 44px; }
}
