/* owns: loy-p- (Tests/Loyalty/LoyaltyCenterPortalTests reads this line - every rule here leads with it, and no other stylesheet
   styles it).
   THE POS CONNECTIONS PREVIEW (docs/claude/LOYALTY.md 5.6) - the provider list (/loyalty/pos: the preview note, the flow picture,
   the provider cards, the six calls), one provider (/loyalty/pos/{key}: its tile, the calls with their doors, the event map with
   its pickers, Connect and the Register dialog), the overview's door to it, and their components (Components/Loyalty/Pos - the
   tile, the note, the flow). loyalty-center.css owns the rest of loy-* (the frame, cards, headings - 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. No brand artwork: a provider is its name and an initials tile. Nothing scrolls sideways at 320px. */

/* ---- The page ---- */
.loy-p-page { display: grid; gap: 16px; min-width: 0; }
.loy-p-muted { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }

/* ---- The preview badge and note ---- */
.loy-p-badge { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 3px 10px; border-radius: var(--wf-radius-pill); background: var(--wf-accent-soft); color: var(--wf-accent-ink); font-size: 12px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.loy-p-badge.is-small { padding: 1px 8px; font-size: 11px; vertical-align: middle; }
.loy-p-note { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 14px 18px; border: 1px dashed var(--wf-line); border-radius: var(--wf-radius-md); background: var(--theme-background-subtle); }
.loy-p-note-body { flex: 1 1 18rem; min-width: 0; }
.loy-p-note-title { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-p-note-text { margin: 4px 0 0; color: var(--theme-text-secondary); font-size: 13px; max-width: 86ch; }

/* ---- The initials tile ---- */
.loy-p-tile { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--wf-radius-md); background: linear-gradient(135deg, var(--wf-primary-soft), var(--wf-accent-soft)); color: var(--wf-primary-ink); font-size: 15px; font-weight: 750; letter-spacing: .04em; box-shadow: inset 0 0 0 1px var(--wf-line); }
.loy-p-tile.is-large { width: 64px; height: 64px; border-radius: var(--wf-radius-lg, var(--wf-radius-md)); font-size: 21px; }
.loy-p-tile i { font-size: 1.25em; }
.loy-p-tile-letters { line-height: 1; }

/* ---- The flow picture ---- */
.loy-p-hero { gap: 16px; }
.loy-p-flow { display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr) minmax(7rem, 9rem); align-items: center; gap: 12px; margin: 0; padding: 18px; border-radius: var(--wf-radius-md); background: var(--theme-background-subtle); }
.loy-p-flow-caption-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loy-p-flow-node { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--theme-background-float); box-shadow: var(--wf-elev-1); text-align: center; min-width: 0; }
.loy-p-flow-node.is-converse { border-color: var(--wf-primary-ink); }
.loy-p-flow-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--wf-radius-pill); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 19px; }
.loy-p-flow-name { color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.loy-p-flow-sub { color: var(--theme-text-secondary); font-size: 11.5px; overflow-wrap: anywhere; }
.loy-p-flow-lanes { display: grid; gap: 18px; min-width: 0; }
.loy-p-flow-lane { display: grid; gap: 6px; min-width: 0; }
.loy-p-flow-lane-title { margin: 0; color: var(--theme-text-secondary); font-size: 12px; font-weight: 650; text-align: center; }
.loy-p-flow-lane-title i { color: var(--wf-primary-ink); }
/* The line: a dashed rule with an arrowhead at each end that carries traffic (both ways for a question and its answer). */
.loy-p-flow-line { position: relative; display: block; height: 2px; margin: 4px 6px; background: repeating-linear-gradient(90deg, var(--wf-primary-ink) 0 6px, transparent 6px 11px); opacity: .7; }
.loy-p-flow-line::before, .loy-p-flow-line::after { content: ""; position: absolute; top: -4px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.loy-p-flow-line.is-both::before { left: -6px; border-right: 7px solid var(--wf-primary-ink); }
.loy-p-flow-line::after { right: -6px; border-left: 7px solid var(--wf-primary-ink); }
/* The traffic: a dot that rides the line. It reuses the house's own slide (wf.css wf-skel-shimmer - from where it stands to its own
   width along), so the carrier is as wide as the line less the dot, and the dot is drawn at its left edge. */
.loy-p-flow-dot { position: absolute; top: -3px; left: 0; width: calc(100% - 8px); height: 8px; background: radial-gradient(circle at 4px 4px, var(--wf-primary-ink) 0 4px, transparent 4.5px); animation: wf-skel-shimmer 3.2s ease-in-out infinite; }
.loy-p-flow-line.is-both .loy-p-flow-dot { animation-direction: alternate; }
@media (prefers-reduced-motion: reduce) { .loy-p-flow-dot { animation: none; transform: translateX(50%); } }
.loy-p-flow-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.loy-p-flow-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-pill); background: var(--theme-background-float); color: var(--theme-text-emphasis); font-size: 12px; }
.loy-p-flow-chip i { color: var(--wf-primary-ink); }
.loy-p-flow-chip.is-event { background: var(--wf-neutral-soft); }
.loy-p-flow-chip.is-coming { border-style: dashed; color: var(--theme-text-secondary); }
.loy-p-flow-soon { color: var(--wf-warning-ink); font-size: 11px; font-weight: 650; }
@media (max-width: 720px) {
    .loy-p-flow { grid-template-columns: minmax(0, 1fr); }
    .loy-p-flow-line { display: none; }
}

/* ---- The provider cards ---- */
.loy-p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.loy-p-grid-item { display: flex; min-width: 0; }
.loy-p-provider { display: grid; align-content: start; gap: 10px; width: 100%; padding: 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--theme-background-float); color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.loy-p-provider:hover, .loy-p-provider:focus-visible { border-color: var(--wf-primary-ink); box-shadow: var(--wf-elev-2); transform: translateY(-1px); color: inherit; }
.loy-p-provider:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .loy-p-provider, .loy-p-provider:hover { transition: none; transform: none; } }
.loy-p-provider-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.loy-p-provider-main { display: grid; flex: 1 1 auto; min-width: 0; }
.loy-p-provider-name { color: var(--theme-text-emphasis); font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.loy-p-provider-kind { color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-p-provider-via { display: flex; align-items: flex-start; gap: 6px; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-p-provider-via i { color: var(--wf-primary-ink); }
.loy-p-provider-go { display: inline-flex; align-items: center; gap: 6px; color: var(--wf-primary-ink); font-size: 13px; font-weight: 600; }

/* ---- The six calls, small (the list page) ---- */
.loy-p-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 10px 16px; margin: 0; padding: 0; list-style: none; }
.loy-p-mini-item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 10px 0; border-top: 1px solid var(--wf-line); }
.loy-p-mini-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: var(--wf-radius-sm); background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.loy-p-mini-main { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.loy-p-mini-name { color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; }
.loy-p-mini-lead { color: var(--theme-text-secondary); font-size: 12.5px; }

/* ---- One provider: who it is ---- */
.loy-p-who { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.loy-p-who-main { display: grid; gap: 6px; min-width: 0; }
.loy-p-who-name { margin: 0; color: var(--theme-text-emphasis); font-size: 20px; font-weight: 700; }
.loy-p-who-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.loy-p-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-emphasis); font-size: 12px; font-weight: 600; }
.loy-p-chip i { color: var(--wf-primary-ink); }
.loy-p-chip.is-role { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }

/* ---- What the register asks: the calls and their doors ---- */
.loy-p-calls { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: loy-p-call; }
.loy-p-call { display: grid; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--wf-line); border-left: 3px solid var(--wf-primary-ink); border-radius: var(--wf-radius-md); background: var(--theme-background-float); }
.loy-p-call.is-coming { border-left-style: dashed; border-left-color: var(--wf-warning-ink); background: var(--theme-background-subtle); }
.loy-p-call-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.loy-p-call-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: var(--wf-radius-sm); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 17px; }
.loy-p-call-main { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.loy-p-call-name { color: var(--theme-text-emphasis); font-size: 14.5px; font-weight: 650; }
.loy-p-call-name::before { counter-increment: loy-p-call; content: counter(loy-p-call) ". "; color: var(--theme-text-secondary); font-weight: 600; }
.loy-p-call-lead { color: var(--theme-text-secondary); font-size: 13px; max-width: 80ch; }
.loy-p-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 8px; margin: 0; padding: 0 0 0 48px; list-style: none; }
.loy-p-door { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 10px 12px; border-radius: var(--wf-radius-sm); background: var(--theme-background-subtle); }
.loy-p-door-label { color: var(--theme-text-emphasis); font-size: 13px; font-weight: 650; }
.loy-p-door-line { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-p-door-line i { color: var(--wf-primary-ink); }
.loy-p-door-term { font-weight: 600; }
.loy-p-door-soon { color: var(--wf-warning-ink); font-weight: 600; }
.loy-p-door-key { color: var(--theme-text-emphasis); }
.loy-p-route { display: inline-block; max-width: 100%; padding: 1px 6px; border-radius: var(--wf-radius-xs, var(--wf-radius-sm)); background: var(--wf-neutral-soft); color: var(--theme-text-emphasis); font-family: var(--theme-font-mono, ui-monospace, monospace); font-size: 12px; overflow-wrap: anywhere; word-break: break-all; }
.loy-p-route.is-tool { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.loy-p-route.is-block { display: block; padding: 8px 10px; }
@media (max-width: 560px) { .loy-p-doors { padding-left: 0; } }

/* ---- What their system tells us: the event map ---- */
.loy-p-map-wrap { min-width: 0; overflow-x: auto; }
.loy-p-map { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.loy-p-map th, .loy-p-map td { padding: 10px 8px; border-top: 1px solid var(--wf-line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.loy-p-map thead th { border-top: 0; color: var(--theme-text-secondary); font-size: 12px; font-weight: 650; }
.loy-p-map tbody th { font-weight: 600; }
.loy-p-map-changed td, .loy-p-map-changed th { background: var(--wf-accent-soft); }
.loy-p-event { color: var(--theme-text-emphasis); }
.loy-p-select { width: 100%; max-width: 20rem; min-width: 0; }
.loy-p-changed { display: inline-block; margin-top: 4px; color: var(--wf-accent-ink); font-size: 11.5px; font-weight: 650; }
.loy-p-map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
@media (max-width: 640px) {
    .loy-p-map thead { display: none; }
    .loy-p-map, .loy-p-map tbody, .loy-p-map tr, .loy-p-map th, .loy-p-map td { display: block; width: 100%; }
    .loy-p-map tr { padding: 8px 0; border-top: 1px solid var(--wf-line); }
    .loy-p-map th, .loy-p-map td { padding: 4px 0; border-top: 0; }
}

/* ---- Connect ---- */
.loy-p-connect { gap: 14px; }
.loy-p-connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 12px; }
.loy-p-block { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--theme-background-float); }
.loy-p-block-title { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; }
.loy-p-block-title i { color: var(--wf-primary-ink); }
.loy-p-block-text { margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.loy-p-block-note { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-p-block-link { justify-self: start; }
.loy-p-check { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: 13px; cursor: pointer; }
.loy-p-check input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--wf-primary-ink); }
.loy-p-stores { display: grid; gap: 4px; max-height: 14rem; margin: 0; padding: 6px 8px; overflow-y: auto; list-style: none; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); }
.loy-p-skel { height: 64px; border-radius: var(--wf-radius-sm); }
.loy-p-connect-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; }

/* ---- The Register dialog ---- */
.loy-p-dialog { max-width: 560px; }
.loy-p-dialog-title { display: flex; align-items: center; font-size: 16px; }
.loy-p-dialog-body { display: grid; gap: 10px; color: var(--theme-text-emphasis); font-size: 13.5px; }
.loy-p-dialog-body p { margin: 0; }
.loy-p-dialog-list { display: grid; gap: 6px; margin: 0; padding: 10px 12px; list-style: none; border-radius: var(--wf-radius-sm); background: var(--theme-background-subtle); }
.loy-p-dialog-list li { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.loy-p-dialog-list i { color: var(--wf-primary-ink); }

/* ---- The overview's door ---- */
.loy-p-hub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.loy-p-hub-body { display: flex; align-items: center; gap: 12px; flex: 1 1 22rem; min-width: 0; }
.loy-p-hub-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--wf-radius-md); background: linear-gradient(135deg, var(--wf-primary-soft), var(--wf-accent-soft)); color: var(--wf-primary-ink); font-size: 19px; }
.loy-p-hub-main { min-width: 0; }
