/* owns: loy-w- (Tests/Loyalty/LoyaltyCenterPortalTests reads this line - every rule here leads with it, and no other stylesheet
   styles it).
   THE LOYALTY CENTER'S MEMBER AND CODE PAGES (docs/claude/LOYALTY.md 5.5) - the members (/loyalty/members: find a member, the list, a
   staff join), one member (/loyalty/members/{id}: the glance, the profile, the wallet with an item's story and acts, the points ledger,
   the visits, the erase) and coupon codes (/loyalty/codes: a new pool, a code looked up, the pools with their stock and the load), and
   their components (Components/Loyalty/Members). This stylesheet owns every loy-w-* class; loyalty-center.css owns the rest of loy-*
   (the frame, cards, fields, notes, rows, 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. Nothing scrolls sideways at 320px; 44px targets on a coarse pointer. */

/* ---- Panels, notes, confirm steps ---- */
.loy-w-panel { display: grid; gap: 14px; }
.loy-w-panel-inner { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); }
.loy-w-quiet { margin: 0; color: var(--theme-text-secondary); font-size: 13px; max-width: 72ch; }
.loy-w-quiet-inline { margin-left: 6px; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-w-confirm { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--wf-line-strong); border-radius: var(--wf-radius-md); background: var(--wf-card); }
.loy-w-confirm-title { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-w-confirm-text { margin: 0; color: var(--theme-text-secondary); font-size: 13px; max-width: 72ch; }
.loy-w-reason { margin: 0; color: var(--theme-text-emphasis); font-size: 13px; }
.loy-w-subhead { margin: 4px 0 0; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; }
.loy-w-bullets { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--theme-text-emphasis); font-size: 13.5px; }
.loy-w-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.loy-w-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.loy-w-moves { display: flex; flex-wrap: wrap; gap: 6px 8px; }

/* ---- Find a member, filters ---- */
.loy-w-find { display: grid; gap: 10px; }
.loy-w-find-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.loy-w-find-input { flex: 1 1 16rem; min-width: 0; max-width: 28rem; }
.loy-w-find-program { width: auto; max-width: 16rem; min-width: 0; }
.loy-w-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.loy-w-filter { width: auto; max-width: 16rem; min-width: 0; }
.loy-w-filter-words { flex: 1 1 14rem; min-width: 0; max-width: 24rem; }

/* ---- Skeletons ---- */
.loy-w-skel-rows { height: 120px; border-radius: var(--wf-radius-md); }
.loy-w-skel-member { height: 220px; border-radius: var(--wf-radius-md); }
.loy-w-skel-detail { height: 96px; border-radius: var(--wf-radius-md); }

/* ---- The tables (members, the points ledger) - fixed, never wider than the card; rows stack under 980px of page ---- */
.loy-w-table { table-layout: fixed; width: 100%; }
.loy-w-table .loy-w-col-status { width: 8rem; }
.loy-w-table .loy-w-col-points { width: 7rem; text-align: right; }
.loy-w-table .loy-w-col-joined { width: 9rem; }
.loy-w-table .loy-w-col-when { width: 11rem; }
.loy-w-table .loy-w-col-member, .loy-w-table .loy-w-col-contact, .loy-w-table .loy-w-col-why, .loy-w-table .loy-w-col-note { text-align: left; }
.loy-w-table td { overflow: hidden; }
.loy-w-table td.loy-w-num { text-align: right; }
.loy-w-num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--theme-text-emphasis); }
.loy-w-num.is-minus { color: var(--wf-danger-ink); }
.loy-w-cell-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loy-w-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loy-w-pager .loy-table-foot { margin-right: auto; }

/* ---- The member's glance ---- */
.loy-w-glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.loy-w-fig { display: grid; align-content: start; gap: 4px; padding: 14px 16px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-card); min-width: 0; }
.loy-w-fig-label { color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
.loy-w-fig-value { color: var(--theme-text-emphasis); font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.loy-w-fig-word { font-size: 17px; letter-spacing: 0; }
.loy-w-fig-sub { color: var(--theme-text-secondary); font-size: 12.5px; }

/* ---- The profile ---- */
.loy-w-birthday { display: flex; gap: 8px; }
.loy-w-birthday .form-select { flex: 1 1 auto; min-width: 0; }
.loy-w-day { width: 5.5rem; flex: 0 0 auto; }
.loy-w-proven { align-self: end; }
.loy-w-facts { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
.loy-w-facts dt { color: var(--theme-text-secondary); font-weight: 600; }
.loy-w-facts dd { margin: 0; color: var(--theme-text-emphasis); overflow-wrap: anywhere; }
.loy-w-standing-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.loy-w-standing-row .loy-field { flex: 1 1 14rem; max-width: 22rem; }

/* ---- The wallet ---- */
.loy-w-items .loy-w-item { align-items: center; }
.loy-w-item.is-open { background: var(--wf-neutral-soft); border-radius: var(--wf-radius-md); padding-left: 10px; padding-right: 10px; }
.loy-w-item-detail { flex: 1 1 100%; display: grid; gap: 12px; padding: 4px 0 8px; min-width: 0; }
.loy-w-story { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; border-left: 2px solid var(--wf-line-strong); }
.loy-w-moment { display: grid; gap: 2px; padding-left: 12px; position: relative; }
.loy-w-moment::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--wf-primary-ink); }
.loy-w-moment-when { color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-w-moment-what { color: var(--theme-text-emphasis); font-size: 13.5px; }

/* ---- The erase ---- */
.loy-w-erase { border-color: var(--wf-line-strong); }
.loy-w-erase-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---- Coupon codes ---- */
.loy-w-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.loy-w-kind { display: grid; gap: 4px; cursor: pointer; }
.loy-w-kind input { position: absolute; opacity: 0; pointer-events: none; }
.loy-w-kind:focus-within { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.loy-w-kind-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-w-kind-hint { color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-w-code-card { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); }
.loy-w-code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.loy-w-code-value { color: var(--theme-text-emphasis); font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.loy-w-pools .loy-w-pool { align-items: center; }
.loy-w-meter { display: block; width: min(16rem, 100%); height: 6px; margin-top: 4px; border-radius: var(--wf-radius-pill); background: var(--wf-inset); overflow: hidden; }
.loy-w-meter-free { display: block; height: 100%; background: var(--wf-data, var(--wf-primary-ink)); }
.loy-w-load { flex: 1 1 100%; display: grid; gap: 12px; padding: 12px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); min-width: 0; }
.loy-w-paste { min-height: 8rem; }
.loy-w-refused { max-height: 14rem; overflow-y: auto; }

@container page (max-width: 980px) {
    .loy-w-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .loy-w-table > tbody > tr { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--wf-line); }
    .loy-w-table > tbody > tr > td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; overflow: visible; text-align: left; }
    .loy-w-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-w-table > tbody > tr > td:first-child { display: grid; }
    .loy-w-table > tbody > tr > td:first-child::before { content: none; }
    .loy-w-table .loy-w-cell-text { white-space: normal; overflow-wrap: anywhere; }
    .loy-w-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container page (max-width: 760px) {
    .loy-w-kinds { grid-template-columns: minmax(0, 1fr); }
    .loy-w-erase-lists { grid-template-columns: minmax(0, 1fr); }
    .loy-w-facts { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
    .loy-w-facts dd { margin-bottom: 8px; }
}

@container page (max-width: 480px) {
    .loy-w-glance { grid-template-columns: minmax(0, 1fr); }
    .loy-w-find-input, .loy-w-find-program, .loy-w-filter, .loy-w-filter-words { flex: 1 1 100%; max-width: none; }
}

@media (pointer: coarse) {
    .loy-w-find-input, .loy-w-filter, .loy-w-filter-words { min-height: 44px; font-size: 16px; }
}
