/* THE LOYALTY CENTER (docs/claude/LOYALTY.md section 5) - every page under /loyalty (Pages/Loyalty) and its components
   (Components/Loyalty): the frame (the left sub-navigation in groups - the Compliance Center's shape), the overview, programs
   and tiers, the field and refusal patterns the page lanes reuse, and the shared parts (the tab strip, the ⋯ menu, the save
   bar). This stylesheet owns every loy-* class but the families a page lane's own loyalty-*.css claims on its first line
   ("owns: loy-x-" - Tests/Loyalty/LoyaltyCenterPortalTests reads it). A token-only door, whole (Tests/ShellTokensOnlyTests): colours are --theme-* /
   --wf-* tokens only, so light, dark and every tenant theme read the same. Shared pieces stay where they live: the page header
   (root.css), KPI tiles and status pills and empty states (components.css), cards and buttons and inputs (wf.css). */

.loy-page { display: grid; gap: 16px; min-width: 0; }

/* ---- The frame: the sub-navigation beside the body ---- */
.loy-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 24px; align-items: start; }
.loy-shell-body { display: grid; gap: 16px; min-width: 0; }
.loy-subnav { display: grid; gap: 2px; position: sticky; top: var(--wf-sticky-top); }
.loy-subnav-group { margin: 12px 0 4px; padding: 0 10px; color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; }
.loy-subnav-group:first-child { margin-top: 0; }
.loy-subnav-link { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; border-radius: var(--wf-radius-pill); color: var(--theme-text-secondary); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.loy-subnav-link i { font-size: 15px; color: var(--theme-text-secondary); }
/* ONLY THE PAGE ON SHOW LOOKS CHOSEN (the tour's fix, 2026-11-06): a link someone clicked keeps no tint of its own - a click
   leaves focus behind on it, and a touch screen leaves its hover stuck there. The hover tint is for a pointer that can hover and
   only while it does; a focused link that is not the page and not under the pointer is plain; a keyboard user's focus is the
   ring (:focus-visible), never a background. */
.loy-subnav-link:hover { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
    .loy-subnav-link:hover { color: var(--theme-text-emphasis); background: var(--wf-neutral-soft); }
}
.loy-subnav-link:focus { outline: none; }
.loy-subnav-link:focus:not(:hover):not(.is-on) { background: transparent; color: var(--theme-text-secondary); }
.loy-subnav-link.is-on { background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-weight: 600; }
.loy-subnav-link.is-on i { color: var(--wf-primary-ink); }
.loy-subnav-link:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.loy-subnav-skel { min-height: 16rem; }
.loy-skel-nav { height: 16rem; border-radius: var(--wf-radius-md); }
.loy-skel-body { height: 12rem; }
.loy-skel-kpis { height: 6rem; }

/* ---- Cards ---- */
.loy-card { min-width: 0; padding: 16px 20px; display: grid; gap: 12px; }
.loy-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.loy-card-title { margin: 0; color: var(--theme-text-emphasis); font-size: 15px; font-weight: 650; }
.loy-card-sub { margin: 2px 0 0; color: var(--theme-text-secondary); font-size: 13px; max-width: 72ch; }
.loy-kpis { padding: 0; }
.loy-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

/* ---- Calm states: the status door unreadable, a page that is coming next ---- */
.loy-calm { gap: 8px; }
.loy-calm-title { margin: 0; color: var(--theme-text-emphasis); font-size: 15px; font-weight: 650; }
.loy-calm-text { margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; max-width: 72ch; }
.loy-calm-actions { display: flex; gap: 8px; }
.loy-coming { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; padding: 24px; }
.loy-coming-art { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--wf-radius-tile); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 22px; }
.loy-coming-text { display: grid; gap: 6px; min-width: 0; }
.loy-coming-title { margin: 0; color: var(--theme-text-emphasis); font-size: 17px; font-weight: 650; }
.loy-coming-lead { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; max-width: 72ch; }
.loy-coming-note { margin: 0; color: var(--theme-text-secondary); font-size: 13px; max-width: 72ch; }

/* ---- Notes and refusals ---- */
.loy-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); color: var(--theme-text-emphasis); font-size: 13px; }
.loy-note i { color: var(--wf-primary-ink); }
.loy-note.is-ok { background: var(--wf-success-soft); }
.loy-note.is-ok i { color: var(--wf-success-ink); }
.loy-note .btn { margin-left: auto; }
.loy-refusal { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-danger-soft); color: var(--theme-text-emphasis); font-size: 13px; }
.loy-refusal > i { color: var(--wf-danger-ink); font-size: 16px; line-height: 1.4; }
.loy-refusal-body { display: grid; gap: 4px; flex: 1 1 auto; min-width: 0; }
.loy-refusal-text { margin: 0; font-weight: 600; }
.loy-refusal-list { margin: 0; padding-left: 18px; color: var(--theme-text-emphasis); }

/* ---- Where a row came from ---- */
.loy-source { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loy-source.is-owned { background: var(--wf-warning-soft); color: var(--wf-warning-ink); }
.loy-source.is-composed { background: transparent; padding-left: 0; font-weight: 500; }

/* ---- Lists ---- */
.loy-rows { display: grid; margin: 0; padding: 0; list-style: none; }
.loy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--wf-line); }
.loy-row:first-child { border-top: 0; }
.loy-row-main { display: grid; gap: 2px; flex: 1 1 14rem; min-width: 0; }
.loy-row-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
a.loy-row-title { color: var(--wf-primary-ink); text-decoration: none; }
a.loy-row-title:hover { text-decoration: underline; }
.loy-row-sub { display: block; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-row-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.loy-role { color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
.loy-reach-roles { margin: 0; color: var(--theme-text-emphasis); font-size: 13.5px; }
.loy-reach-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.loy-reach-line i { color: var(--wf-primary-ink); }

/* ---- The overview header's guides zip: its size, muted beside the words (Diagrams and Download the guides, 2026-11-12) ---- */
.loy-zip-note { color: var(--theme-text-secondary); font-weight: 400; }
.loy-mono { font-family: var(--theme-font-mono, ui-monospace, monospace); font-size: 12.5px; }
.loy-table { margin: 0; table-layout: fixed; width: 100%; }
.loy-table td { white-space: normal; vertical-align: middle; }
.loy-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- The getting-started path ---- */
.loy-start { background: var(--wf-card); }
.loy-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.loy-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--wf-line); }
.loy-step:first-child { border-top: 0; }
.loy-step-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--wf-neutral-soft); color: var(--theme-text-secondary); flex: 0 0 auto; }
.loy-step.is-done .loy-step-mark { background: var(--wf-success-soft); color: var(--wf-success-ink); }
.loy-step-text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.loy-step-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; }
.loy-step.is-done .loy-step-title { color: var(--theme-text-secondary); }
.loy-step-sub { color: var(--theme-text-secondary); font-size: 12.5px; }

/* ---- Forms (portal-look-and-feel 3.11): the label above, one line of hint or finding below ---- */
.loy-form { gap: 0; padding: 0; }
.loy-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.loy-form-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 24px; padding: 20px; border-top: 1px solid var(--wf-line); }
.loy-fieldset > .loy-form-section:first-child { border-top: 0; }
.loy-form-why { display: grid; gap: 4px; align-content: start; }
.loy-form-title { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-form-sub { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-form-fields { display: grid; gap: 14px; min-width: 0; }
.loy-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.loy-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 14px; align-items: start; }
.loy-form-row.is-four { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
.loy-form-lead { margin: 4px 0 -4px; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 600; }
.loy-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--wf-line); }
.loy-new .loy-form-actions,
.loy-tier-editor .loy-form-actions { padding: 0; border-top: 0; }
/* align-content: start - a field stretched to a taller neighbour's height (a hint under the Status beside a Name with none) keeps
   its label and control at the top, so a row's boxes line up; the extra height stays empty below (the tour's fix, 2026-11-06). */
.loy-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.loy-field-narrow { max-width: 12rem; }
.loy-field-label { margin: 0; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 600; }
.loy-field-optional { margin-left: 4px; color: var(--theme-text-secondary); font-weight: 500; }
.loy-field-hint { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-field-error { margin: 0; color: var(--wf-danger-ink); font-size: 12.5px; font-weight: 600; }
.loy-field.is-invalid .form-control,
.loy-field.is-invalid .form-select { border-color: var(--theme-danger); box-shadow: 0 0 0 3px var(--wf-danger-soft); }
.loy-num-input { max-width: 10rem; font-variant-numeric: tabular-nums; }
.loy-code-input { max-width: 6rem; text-transform: uppercase; }
.loy-checks { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.loy-check { display: inline-flex; align-items: center; gap: 8px; color: var(--theme-text-emphasis); font-size: 13.5px; cursor: pointer; }
.loy-check input { width: 16px; height: 16px; accent-color: var(--wf-primary-ink); }
.loy-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loy-confirm-text { color: var(--theme-text-emphasis); font-size: 13px; font-weight: 600; }

/* ---- The essentials, and "more options" behind a summary that says what is set (portal-look-and-feel 3.11) ---- */
.loy-essentials { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 14px 16px; padding: 20px; align-items: start; }
.loy-more { border-top: 1px solid var(--wf-line); }
.loy-more-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 14px; padding: 14px 20px 14px 40px; position: relative; list-style: none; cursor: pointer; }
.loy-more-summary::-webkit-details-marker { display: none; }
.loy-more-summary::before { content: "\203A"; position: absolute; left: 20px; top: 12px; color: var(--theme-text-secondary); font-size: 18px; line-height: 1; transition: transform 120ms ease; }
.loy-more[open] > .loy-more-summary::before { transform: rotate(90deg); }
.loy-more-summary:hover { background: var(--wf-neutral-soft); }
.loy-more-summary:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.loy-more-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.loy-more-line { color: var(--theme-text-secondary); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loy-more[open] > .loy-more-summary .loy-more-line { white-space: normal; }
.loy-more-body { display: grid; gap: 14px; padding: 4px 20px 20px 40px; min-width: 0; }
.loy-note.is-warn { background: var(--wf-warning-soft); }
.loy-note.is-warn i { color: var(--wf-warning-ink); }

/* ---- The house merchant, the source filter, the table's foot, sources gone quiet ---- */
.loy-house { border-color: var(--wf-line-strong); }
.loy-house .loy-form-actions { padding: 0; border-top: 0; }
.loy-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.loy-filters-label { margin-right: 4px; color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
.loy-filters-count { margin-left: 4px; color: var(--theme-text-secondary); font-variant-numeric: tabular-nums; }
.loy-table-foot { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.loy-stale { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-warning-soft); color: var(--theme-text-emphasis); font-size: 13px; }
.loy-stale > i { color: var(--wf-warning-ink); font-size: 16px; line-height: 1.4; }
.loy-stale-body { display: grid; gap: 4px; min-width: 0; }
.loy-stale-title { margin: 0; font-weight: 650; }
.loy-stale-list { margin: 0; padding-left: 18px; }
.loy-stale-text { margin: 0; color: var(--theme-text-secondary); }

/* ---- The Center's one tab strip, ⋯ menu and floating save bar (the shared parts every page uses) ---- */
.loy-tabs-slot { min-width: 0; }
.loy-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--wf-line); }
.loy-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--theme-text-secondary); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.loy-tab:hover { color: var(--theme-text-emphasis); }
.loy-tab.is-on { border-bottom-color: var(--wf-primary-ink); color: var(--wf-primary-ink); }
.loy-tab:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.loy-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.loy-tab.is-on .loy-tab-count { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.loy-menu { display: inline-flex; }
.loy-savebar { gap: 12px; }
.loy-savebar-text { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.loy-savebar-text i { color: var(--wf-warning-ink); }
.loy-savebar-text.is-ok i { color: var(--wf-success-ink); }

/* ---- Tiers ---- */
.loy-tiers { display: grid; margin: 0; padding: 0; list-style: none; }
.loy-tier { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--wf-line); }
.loy-tier:first-child { border-top: 0; }
.loy-tier-rank { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: var(--wf-radius-tile); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.loy-tier-main { display: grid; gap: 2px; flex: 1 1 14rem; min-width: 0; }
.loy-tier-benefits { color: var(--theme-text-emphasis); font-size: 13px; }
.loy-tier-editor { display: grid; gap: 12px; flex: 1 1 100%; padding: 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); }

/* ---- Narrower sheets ---- */
@container page (max-width: 960px) {
    .loy-split { grid-template-columns: minmax(0, 1fr); }
    .loy-form-section { grid-template-columns: minmax(0, 1fr); }
}

@container page (max-width: 760px) {
    .loy-shell { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .loy-subnav { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
    .loy-subnav-group { display: none; }
    .loy-form-grid { grid-template-columns: minmax(0, 1fr); }
    .loy-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .loy-table tr { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--wf-line); }
    .loy-table td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; text-align: left; }
    .loy-table td::before { content: attr(data-label); color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; }
    .loy-table td:first-child { display: grid; }
    .loy-table td:first-child::before { content: none; }
    .loy-coming { grid-template-columns: minmax(0, 1fr); }
    .loy-essentials { padding: 16px; }
    .loy-more-summary { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 12px 36px; }
    .loy-more-summary::before { left: 16px; }
    .loy-more-body { padding: 4px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .loy-subnav-link { transition: none; }
    .loy-more-summary::before { transition: none; }
}
