/* ==========================================================================
   PointsCalc — site stylesheet, used by every page (calc.php, index.php,
   value.php, offers.php and the static pages). Loaded by partials/site-header.php.
   Plain modern CSS: custom properties, grid, :has(), clamp(), logical props.
   ========================================================================== */

:root {
    --bg:          #ffffff;
    --surface:     #ffffff;
    --surface-alt: #f7f8fa;
    --ink:         #0f172a;
    --ink-2:       #334155;
    --muted:       #475569;
    --faint:       #64748b;
    --line:        #e2e5ea;
    --line-strong: #b8c0cc;

    --accent:      #2563eb;
    --accent-ink:  #1d4ed8;
    --accent-soft: #eff4ff;
    --good:        #047857;
    --warn:        #b45309;
    --bad:         #dc2626;

    --radius:      14px;
    --radius-sm:   8px;
    --shadow:      0 1px 2px rgb(15 23 42 / .04), 0 4px 16px rgb(15 23 42 / .05);
    --ring:        0 0 0 3px rgb(37 99 235 / .18);

    --label-col:   210px;
    --gutter:      clamp(16px, 4vw, 40px);
    --page-max:    1200px;

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

.hidden { display: none !important; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.topbar {
    position: relative;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: 0 var(--gutter);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -.01em;
    font-size: 1.05rem;
    flex-shrink: 0;
    /* Larger click target: padding grows the hit area, the matching negative
       margin keeps the logo exactly where it was. */
    padding: 6px 12px 6px 8px;
    margin: -6px -12px -6px -8px;
    border-radius: var(--radius-sm);
    transition: background-color .15s;
}
.brand:hover { color: var(--ink); background: var(--surface-alt); }
.brand:focus-visible { outline: none; box-shadow: var(--ring); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .975rem;
}

.topnav a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.topnav a:hover { color: var(--ink); background: var(--surface-alt); }
.topnav > a[aria-current] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }

/* Programs menu: disclosure button + panel of program hubs */
.nav-menu { position: relative; }
.nav-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 12px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.nav-menu-btn:hover { color: var(--ink); background: var(--surface-alt); }
.nav-menu-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-menu-btn.is-current { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.nav-menu-btn svg { transition: transform .15s; }
.nav-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 460px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgb(15 23 42 / .12);
}
.nav-menu-panel[hidden] { display: none; }
.nav-menu-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
}
.nav-menu-panel a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    white-space: nowrap;
}
.nav-menu-panel a:hover { color: var(--accent-ink); background: var(--accent-soft); }
.nav-menu-panel a[aria-current] { color: var(--accent-ink); font-weight: 600; }

.menu-btn {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink);
    cursor: pointer;
}
.menu-btn:hover { background: var(--surface-alt); }
.menu-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.menu-icon-close { display: none; }
.menu-open .menu-icon-open  { display: none; }
.menu-open .menu-icon-close { display: inline; }

/* ── Page ────────────────────────────────────────────────────────────────── */

.page {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: clamp(24px, 4vw, 48px) var(--gutter) 64px;
}

.page-head { margin-bottom: 28px; }
.page-head h1 {
    margin: 0;
    font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -.02em;
}

/* ── Calculator layout: fields + sticky result panel ─────────────────────── */

.calc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
}

.calc-fields {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.field {
    display: grid;
    grid-template-columns: var(--label-col) minmax(0, 1fr);
    gap: 6px 24px;
    align-items: start;
    padding: 16px 24px;
}
/* ~ rather than +: a non-field sibling (the custom offer <template> before Nights)
   must not drop the divider */
.field ~ .field { border-top: 1px solid var(--line); }

.field-label {
    padding-top: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--ink);
}

.currency-prefix { color: var(--muted); font-weight: 500; }

/* ── Controls ────────────────────────────────────────────────────────────── */

.input,
.select {
    font: inherit;
    font-size: 1.0625rem;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    height: 44px;
    box-shadow: inset 0 1px 2px rgb(15 23 42 / .05);
    padding: 0 12px;
    transition: border-color .15s, box-shadow .15s;
}
.input { width: 170px; font-variant-numeric: tabular-nums; }
.input--sm { width: 110px; }
.select {
    min-width: 210px;
    max-width: 100%;
    padding-right: 36px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
.select--wide { min-width: 280px; }

.input:hover, .select:hover { border-color: #8a96a8; }
.input:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}
.input[readonly] { background: var(--surface-alt); color: var(--muted); }

input[type="radio"],
input[type="checkbox"] {
    accent-color: var(--accent);
    width: 19px;
    height: 19px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.choices { display: flex; flex-direction: column; gap: 2px; }
.stack   { display: flex; flex-direction: column; gap: 10px; }
.inline  { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.inline--tight { gap: 6px; }

.choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    color: var(--ink);
    line-height: 1.35;
}
.choice:has(input:checked) { font-weight: 500; }

.unit, .note, .hint { color: var(--muted); }
.unit { font-size: .95rem; }
.note, .hint { font-size: .9rem; }

.add-link,
.toggle-all {
    font-size: .925rem;
    font-weight: 500;
    text-decoration: none;
    width: fit-content;
}
.add-link:hover, .toggle-all:hover { text-decoration: underline; }
.toggle-all { display: block; margin-top: 2px; }

.inline--loose { gap: 8px 16px; }

.choices--nested { margin-left: 28px; }
.choice--sub { font-size: .95rem; align-items: flex-start; }
.choice--sub input { margin-top: 2px; }
.choice--requires,
.promo-body .choice--requires { margin-left: 20px; }

.static-value { padding-top: 8px; }
.empty-note { padding-top: 8px; color: var(--muted); font-style: italic; }
.warn-text { color: var(--warn); }

.link-sm {
    font-size: .925rem;
    font-weight: 500;
    color: var(--accent);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    width: fit-content;
}
.link-sm:hover { text-decoration: underline; }

/* "Copy link" under the result panel (js/share-link.js) */
.share-link {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px auto 0;
    padding: 4px 8px;
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.share-link svg { width: 14px; height: 14px; flex: none; }
.share-link:hover { color: var(--accent); }
.share-link:focus-visible { outline: none; box-shadow: var(--ring); }
.share-link.is-copied { color: var(--good); }

.custom-offer-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
/* value + unit + remove ×: wraps as one unit below the type select when space runs out, and a
   long unit ("× base points") wraps its own text rather than pushing × onto a new line */
.custom-offer-amount { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
/* 90px holds a 5-digit bonus; narrower than .input--sm so type + amount + "× base points"
   + × fit on one line in the desktop field column (464px at full width) */
.custom-offer-amount .input { flex-shrink: 0; width: 90px; }
/* No spinner here: stepping a 10,000-point bonus by 1 is useless, and it would eat a
   fifth of the 90px */
.custom-offer-value { appearance: textfield; -moz-appearance: textfield; }
.custom-offer-value::-webkit-inner-spin-button,
.custom-offer-value::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.custom-offer-suffix { min-width: 0; line-height: 1.25; }
.custom-offer-remove { flex-shrink: 0; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--faint);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.icon-btn:hover { background: #fef2f2; color: var(--bad); }

/* ── Offers ──────────────────────────────────────────────────────────────── */

/* The offers row drops the label column so the cards get the full width */
.field:has(#toggle-all-offers) { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.field:has(#toggle-all-offers) .field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 0;
}
/* Each offer group renders as a card: .promo-head is the top of the card and
   .promo-body (when expanded) is the bottom. One type scale only: titles and
   options in ink at body size, everything secondary in muted at .95rem. */

.scope-head { margin: 0 0 10px; }
.scope-head--divider { margin-top: 28px; }
.scope-head button { display: inline-flex; align-items: center; gap: 6px; }

.scope-label {
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.promo-gap { height: 10px; }

.promo-head {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px 14px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    transition: background-color .15s;
}
.promo-head:hover { background: var(--surface-alt); }
.promo-head:has(+ .collapsible-content.expanded) {
    border-bottom-width: 0;
    padding-bottom: 13px;
    border-radius: 12px 12px 0 0;
}
.promo-head:has(+ .collapsible-content.expanded):hover { background: var(--surface); }

.promo-toggle {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}
.promo-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.chevron {
    width: 14px;
    height: 14px;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform .2s ease;
}

.promo-title { font-weight: 600; color: var(--ink); line-height: 1.35; }

/* Collapsed offer with an option chosen ("None" radios carry data-none, so they
   don't count): accent border on the card and a dot after the title */
.promo-head:has(+ .collapsible-content:not(.expanded) input:checked:not([data-none])) {
    border-color: #9db8f5;
}
.promo-head:has(+ .collapsible-content:not(.expanded) input:checked:not([data-none])) .promo-title::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 50%;
    background: var(--accent);
}

/* Register / More info: drop the literal brackets, show the link as a small button */
.promo-link { font-size: 0; flex-shrink: 0; }
.promo-link a {
    display: inline-block;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-ink);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 999px;
}
.promo-link a:hover { background: #dfe9ff; }

.promo-terms {
    font-size: .9rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.promo-terms:hover { color: var(--accent-ink); text-decoration: underline; }

.collapsible-content { display: none; }
.collapsible-content.expanded { display: flex; flex-direction: column; }

.promo-body {
    padding: 0 16px 10px;
    border: 1px solid var(--line-strong);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    gap: 0;
}

.promo-meta {
    font-size: .95rem;
    line-height: 1.5;
    color: var(--muted);
    margin: 0 0 8px 24px;
}

.promo-deadline,
.promo-closed {
    align-self: flex-start;
    font-size: .9rem;
    font-weight: 600;
    margin: 0 0 8px 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.promo-deadline::before,
.promo-closed::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.promo-deadline { color: var(--warn); }
.promo-closed   { color: var(--bad); }

/* Options: full-width rows, selected one tinted */
.promo-body .choice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -8px;
    padding: 8px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 400;
    border-top: 1px solid var(--line);
}
.promo-body .choice:first-of-type { margin-top: 4px; border-top-color: transparent; }
.promo-body .choice:hover { background: var(--surface-alt); }
.promo-body .choice:has(input:checked) {
    background: var(--accent-soft);
    border-top-color: transparent;
    font-weight: 500;
}
.promo-body .choice:has(input:checked) + .choice { border-top-color: transparent; }

.closed-body { padding-top: 10px; }

/* ── Result panel ────────────────────────────────────────────────────────── */

/* Right column: the result panel plus the Copy link under it, sticky together */
.calc-side {
    position: sticky;
    /* fitStickyResultPanel() in hotelcalc.js lowers this below zero when the column
       is taller than the viewport, so it scrolls with the page instead of clipping */
    top: 24px;
}

.calc-result {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.result-label {
    margin: 0 0 6px;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Placeholder dash until the first calculation fills #totalPoints (earn) */
.result-body:not(:has(#totalPoints[style*="block"]))::before {
    content: "—";
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--line-strong);
}

/* Empty state, shared by the earn and compare panels until a cost is entered */
.result-empty { display: none; }
.calc-result.is-empty .result-empty { display: block; }
.calc-result.is-empty .result-body,
.calc-result.is-empty .compare { display: none !important; }
.result-placeholder {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--line-strong);
}
.result-hint { margin: 4px 0 0; font-size: .95rem; color: var(--muted); }

.result-total {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--good);
    font-variant-numeric: tabular-nums;
}
.result-sub {
    margin-top: 4px;
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
}

.result-ros {
    margin-top: 6px;
    font-size: .975rem;
    color: var(--ink-2);
}

.result-breakdown {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line-strong);
    font-size: .975rem;
    color: var(--ink-2);
}
.breakdown { width: 100%; border-collapse: collapse; }
.breakdown td { padding: 3px 0; vertical-align: top; }
.breakdown td.num {
    padding-left: 16px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.breakdown-total td {
    padding-top: 8px;
    border-top: 1px solid var(--line-strong);
    font-weight: 700;
    color: var(--ink);
}
.breakdown-cash { color: var(--good); }

.result-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    font: inherit;
    font-weight: 600;
    border-radius: 10px;
    height: 46px;
    padding: 0 22px;
    font-size: 1.0625rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.btn-primary {
    flex: 1;
    border: 0;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 1px 2px rgb(37 99 235 / .3);
}
.btn-primary:hover  { background: var(--accent-ink); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-ghost {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--muted);
    font-weight: 500;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--faint); }

/* Compare page: verdict first, then one compact row per option (cheapest first —
   calculateCompare() sets each row's order), then the "How these were calculated"
   toggle. The full workings only show once .is-detailed is set. */
.compare { display: flex; flex-direction: column; gap: 8px; }

.compare-caption { order: 0; margin: 4px 0 0; font-size: .875rem; color: var(--muted); }

.compare-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 12px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
}
.compare-card > * { grid-column: 1 / -1; }
.compare-card.is-best--cash   { border-color: var(--good);   box-shadow: 0 0 0 1px var(--good); }
.compare-card.is-best--points { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.compare-card-head { grid-column: 1; align-self: center; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.compare-card-title { font-weight: 600; color: var(--ink); }
.compare-hero { grid-column: 2; grid-row: 1; text-align: right; line-height: 1.3; }
.compare-hero-value {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.compare-hero-label { display: none; font-size: .8rem; color: var(--muted); }
.compare-summary { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.compare-summary:empty { display: none; }

.compare-details { display: none; gap: 2px; font-size: .9rem; color: var(--ink-2); }
.compare-breakdown, .compare-note { display: none; }
.compare.is-detailed .compare-details { display: grid; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.compare.is-detailed .compare-hero-label { display: block; }
.compare.is-detailed .compare-breakdown:not(:empty) { display: block !important; margin-top: 8px; font-size: .9rem; }
.compare.is-detailed .compare-note { display: block; margin: 6px 0 0; }

.compare-toggle {
    order: 20;
    align-self: flex-start;
    padding: 4px 0;
    font-family: inherit;
}
.compare-toggle::before { content: "\25B8\00A0"; display: inline-block; transition: transform .15s; }
.compare-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
#compareFixedNote { order: 21; margin: 0; }

.badge {
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge--cash   { color: var(--good); background: #ecfdf5; }
.badge--points { color: var(--accent-ink); background: var(--accent-soft); }

.verdict {
    order: -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}
.verdict-icon { width: 22px; height: 22px; flex-shrink: 0; }
.verdict-text { font-weight: 700; font-size: 1.05rem; }
.verdict-sub  { font-size: .95rem; }
.verdict--neutral .verdict-text { color: var(--muted); }
.verdict--cash   { background: #ecfdf5; border-color: #a7f3d0; color: var(--good); }
.verdict--points { background: var(--accent-soft); border-color: #bfd3fe; color: var(--accent-ink); }

/* Narrow screens: verdict pinned to the bottom until the result panel scrolls into
   view (updateMobileVerdict() in hotelcalc.js). Desktop has the sticky side panel. */
.mobile-verdict {
    position: fixed;
    z-index: 40;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 6px 24px rgb(15 23 42 / .18);
    font: inherit;
    text-align: left;
    cursor: pointer;
    animation: mobile-verdict-in .2s ease-out;
}
.mobile-verdict[hidden] { display: none; }
.mobile-verdict[data-tone="cash"]   { background: #ecfdf5; border-color: #a7f3d0; color: var(--good); }
.mobile-verdict[data-tone="points"] { background: var(--accent-soft); border-color: #bfd3fe; color: var(--accent-ink); }
.mobile-verdict-text { font-weight: 700; }
.mobile-verdict-cta  { flex-shrink: 0; font-size: .9rem; font-weight: 500; white-space: nowrap; }
@keyframes mobile-verdict-in { from { transform: translateY(16px); opacity: 0; } }
@media (min-width: 961px) { .mobile-verdict { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .mobile-verdict { animation: none; } }

/* ── Value page (value.php): average-value hero + one bar per redemption level ── */

.value-layout { display: grid; gap: 28px; max-width: 880px; }

/* Hero: average value on the left, balance + its worth on the right */
.value-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    border: 1px solid #bfd3fe;
    border-radius: var(--radius);
    background: var(--accent-soft);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.value-hero-main { padding: 28px; }
.value-kicker {
    margin: 0;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--accent-ink);
}
.value-big {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 6px 0 0;
    line-height: 1;
}
.value-big-num {
    font-size: clamp(2.75rem, 2rem + 3vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.value-big-unit { font-size: 1.125rem; font-weight: 600; color: var(--ink-2); }
.value-hero-note { margin: 14px 0 0; font-size: 1rem; color: var(--ink-2); max-width: 36ch; }
.value-hero-note strong { color: var(--ink); }

.value-hero-calc {
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
    background: var(--surface);
    border-left: 1px solid #bfd3fe;
}
.value-input-label { font-weight: 600; font-size: 1rem; margin-bottom: 8px; }
.value-input { width: 100%; height: 52px; font-size: 1.25rem; }
.value-worth { margin-top: 16px; }
.value-worth-num {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--line-strong);
    font-variant-numeric: tabular-nums;
}
.value-worth.is-filled .value-worth-num { color: var(--good); }
.value-worth-sub   { margin-top: 2px; font-size: .95rem; color: var(--muted); }
.value-worth-range { margin-top: 6px; font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.value-hero-calc .share-link { margin: auto 0 0 -8px; padding-top: 14px; align-self: flex-start; }

/* Range: one row per redemption level, bar length = value per point */
.value-range-title { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.value-range-intro { margin: 4px 0 0; color: var(--muted); font-size: 1rem; }

.value-tiers { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; }
.value-tier { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.value-tier.is-average { background: var(--accent-soft); border-color: #bfd3fe; }
.value-tier-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.value-tier-name { font-weight: 600; }
.value-tier-figures { display: flex; align-items: baseline; gap: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.value-tier-cpp { font-weight: 700; font-size: 1.0625rem; white-space: nowrap; }
.value-tier-per { font-weight: 400; font-size: .85rem; color: var(--muted); }
.value-tier-worth { font-weight: 700; font-size: 1.125rem; white-space: nowrap; color: var(--good); }
/* Once a balance is entered, the dollar worth leads and the per-point figure steps back */
.value-tiers.has-balance .value-tier-cpp { font-weight: 500; font-size: .9rem; color: var(--muted); }
.value-tier-worth:empty { display: none; }

.value-bar {
    position: relative;
    height: 12px;
    margin-top: 10px;
    border-radius: 999px;
    background: #eef1f5;
}
.value-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
}
.value-tier--poor .value-bar > span { background: #f59e0b; }
.value-tier.is-average .value-bar > span { background: var(--accent); }
.value-tier--good .value-bar > span,
.value-tier--excellent .value-bar > span { background: #10b981; }
/* Average marker on every bar, so "better / worse than average" reads at a glance */
.value-tiers .value-bar::after {
    content: "";
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: var(--avg);
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    background: var(--ink);
    opacity: .55;
}
.value-tier-sub { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }

.value-notes { margin-top: 18px; font-size: .9rem; color: var(--muted); }
.value-notes p { margin: 0; }
.value-notes p + p { margin-top: 6px; }
.value-hero + .value-range:not(:has(.value-tiers)) .value-notes { margin-top: 0; }

@media (max-width: 720px) {
    .value-layout { gap: 24px; }
    .value-hero { grid-template-columns: minmax(0, 1fr); }
    .value-hero-main { padding: 22px 20px 20px; }
    .value-hero-calc { padding: 20px; border-left: 0; border-top: 1px solid #bfd3fe; }
    .value-hero-note { max-width: none; }
    .value-tier { padding: 12px; }
    .value-tier-figures { flex-direction: column; align-items: flex-end; gap: 0; }
}

/* ── Offers pages (offers.php): index + per-chain offer cards ─────────────── */

.page-lede { max-width: 720px; margin: 10px 0 0; color: var(--muted); font-size: 1.0625rem; }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    font-size: .925rem;
    color: var(--faint);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }

.tool-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tool-pills a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: .925rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.tool-pills a:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.tool-pills a[aria-current] {
    color: var(--accent-ink);
    border-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}
.page--text .hero-picker { margin-top: 28px; }

.badge--closed { color: var(--bad); background: #fef2f2; }
.badge--warn   { color: var(--warn); background: #fffbeb; }

/* Index: one card per program with offers */
.chain-offer-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.chain-offer-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s;
}
.chain-offer-card:hover { color: var(--ink); border-color: var(--accent); }
.chain-offer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chain-offer-name { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }
.chain-offer-top { flex: 1; color: var(--ink-2); font-size: .975rem; line-height: 1.45; }
.chain-offer-top-label {
    display: block;
    margin-bottom: 2px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}
.chain-offer-cta { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: .95rem; }
.chain-offer-cta svg { transition: transform .15s; }
.chain-offer-card:hover .chain-offer-cta svg { transform: translateX(3px); }

.offers-none { margin: 32px 0 0; font-size: .95rem; color: var(--muted); }

/* Per-chain: offer cards */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}
.offer-scope { grid-column: 1 / -1; margin: 12px 0 -6px; }
.offer-scope:first-child { margin-top: 0; }

.offer-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    scroll-margin-top: 16px;
}
.offer-card:target { border-color: var(--accent); box-shadow: var(--ring), var(--shadow); }

.offer-media { aspect-ratio: 2 / 1; overflow: hidden; background: var(--surface-alt); }
.offer-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.offer-media--plain {
    display: grid;
    place-items: center;
    padding: 16px;
    text-align: center;
}
.offer-media--plain span { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: rgb(255 255 255 / .22); user-select: none; }
.offer-card.is-closed .offer-media { opacity: .6; }

.offer-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 16px; }
.offer-body h3 { margin: 0; font-size: 1.125rem; line-height: 1.3; letter-spacing: -.01em; }
.offer-meta { margin: 6px 0 0; font-size: .925rem; color: var(--muted); }
.offer-body > .badge { align-self: flex-start; margin-top: 10px; }

.offer-options { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .975rem; color: var(--ink-2); }
.offer-options li { position: relative; padding-left: 18px; }
.offer-options li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .6em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.offer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: .95rem;
    font-weight: 500;
}
.offer-foot a { text-decoration: none; }
.offer-foot a:hover { text-decoration: underline; }
.offer-calc { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); }
.offer-calc:hover { color: var(--accent-ink); }

/* Terms & details expander (partials/offer-details.php) */
.offer-details { margin-top: 12px; font-size: .925rem; }
.offer-details summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    color: var(--muted);
    font-weight: 500;
}
.offer-details summary::-webkit-details-marker { display: none; }
.offer-details summary:hover { color: var(--accent-ink); }
.offer-details summary svg { transition: transform .15s; }
.offer-details[open] summary svg { transform: rotate(90deg); }
.offer-details-body {
    display: grid;
    gap: 12px;
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--ink-2);
    line-height: 1.5;
}
.offer-details-body h4 {
    margin: 0 0 4px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}
.offer-details-body p { margin: 0; }
.offer-details-body ul,
.offer-details-body ol { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.offer-details-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.offer-details-checked { font-size: .85rem; color: var(--faint); }

.offers-official { margin: 24px 0 0; font-size: .95rem; color: var(--muted); }

.offers-empty { padding: 48px 0; text-align: center; color: var(--muted); font-size: 1.0625rem; }
.offers-empty p { max-width: 580px; margin: 0 auto 14px; }
.offers-empty-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; font-size: .95rem; }

/* Recently expired: collapsed block of muted cards */
.offers-expired { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.offers-expired > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.offers-expired > summary::-webkit-details-marker { display: none; }
.offers-expired > summary:hover { color: var(--ink); }
.offers-expired > summary svg { transition: transform .15s; }
.offers-expired[open] > summary svg { transform: rotate(90deg); }
.offer-card.is-expired { background: var(--surface-alt); box-shadow: none; }
.offer-card.is-expired .offer-body h3,
.offer-card.is-expired .offer-options { color: var(--muted); }
.offer-card.is-expired .offer-options li::before { background: var(--line-strong); }
.offer-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.offer-ended { flex-shrink: 0; margin-top: 3px; font-size: .85rem; color: var(--faint); }

/* Standard program offer rules */
.offers-terms {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    max-width: 780px;
    color: var(--ink-2);
    scroll-margin-top: 16px;
}
.offers-terms h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; color: var(--ink); }
.offers-terms-intro { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.offers-terms ul { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.offers-terms > p:last-child { margin: 14px 0 0; }

@media (max-width: 800px) {
    .offer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Static text pages (about, contact, privacy, disclaimer) ─────────────── */

.page--text { max-width: calc(720px + 2 * var(--gutter)); }
.page--text h1 {
    margin: 0 0 20px;
    font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -.025em;
}
.text-meta { margin: -12px 0 28px; font-size: .925rem; color: var(--faint); }
.text-body { color: var(--ink-2); line-height: 1.7; }
.text-body p { margin: 0; }
.text-body p + p { margin-top: 16px; }
.text-body section + section { margin-top: 32px; }
.text-body h2 { margin: 0 0 8px; font-size: 1.25rem; letter-spacing: -.01em; color: var(--ink); }
.text-note { font-size: .925rem; color: var(--muted); }

/* ── Help text ───────────────────────────────────────────────────────────── */

/* Single column the width of the form column; each entry mirrors a form row:
   field name on the left, explanation on the right. Selectors are by element
   because the help partials (partials/help/*.php) are plain h2/div/h3/p. */
.help {
    margin-top: 56px;
    max-width: calc(100% - 340px - 32px);
    font-size: 1rem;
    color: var(--ink-2);
}
.help h2 {
    margin: 40px 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink);
}
.help h2:first-child { margin-top: 0; }
.help > div {
    display: grid;
    grid-template-columns: var(--label-col) minmax(0, 1fr);
    gap: 0 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.help > div:last-child,
.help > div:has(+ h2) { border-bottom: 0; }
.help h3 {
    grid-column: 1;
    grid-row: 1 / span 20;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ink);
}
.help > div > :not(h3) { grid-column: 2; }
.help p { margin: 0; line-height: 1.65; }
.help p + p { margin-top: 10px; }
.help p:empty { display: none; }

/* ── Home ────────────────────────────────────────────────────────────────── */

.hero {
    max-width: 860px;
    margin-inline: auto;
    padding: clamp(56px, 9vw, 112px) var(--gutter) clamp(40px, 6vw, 72px);
    text-align: center;
}
.hero-eyebrow {
    display: inline-block;
    margin: 0 0 20px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: .9rem;
    font-weight: 600;
}
.hero-title {
    margin: 0;
    font-size: clamp(2.3rem, 1.4rem + 4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.035em;
    text-wrap: balance;
}
.hero-lede {
    max-width: 640px;
    margin: 24px auto 0;
    font-size: clamp(1.0625rem, 1rem + .3vw, 1.2rem);
    line-height: 1.6;
    color: var(--muted);
    text-wrap: pretty;
}
.hero-picker {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}
.hero-picker .select { height: 46px; min-width: 220px; }
.hero-picker .select + .select { min-width: 190px; }
.hero-picker .btn-primary { flex: none; }

.home-search { position: relative; max-width: 600px; margin: 32px auto 0; text-align: left; }
.home-search[hidden], .home-search-results[hidden], .home-search-empty[hidden] { display: none; }
.home-search > label { display: block; margin-bottom: 8px; font-size: .95rem; font-weight: 600; }
.home-search-field { position: relative; }
.home-search-field > svg { position: absolute; left: 16px; top: 17px; color: var(--muted); pointer-events: none; }
.home-search input {
    width: 100%; min-height: 54px; padding: 12px 16px 12px 46px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit; caret-color: var(--accent);
}
.home-search input::placeholder { color: var(--muted); opacity: 1; }
.home-search input:focus-visible, .home-search-results a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-search-results {
    position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 10;
    max-height: min(360px, 50dvh); overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    scrollbar-color: var(--line-strong) var(--surface);
}
.home-search-results ul { list-style: none; padding: 4px; margin: 0; }
.home-search-results li + li { border-top: 1px solid var(--line); }
.home-search-results a { display: block; padding: 12px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.home-search-results a:hover, .home-search-results a:focus { background: var(--accent-soft); }
.home-search-results a:focus-visible { outline-offset: -2px; }
.home-search-results span { display: block; font-size: .95rem; font-weight: 600; }
.home-search-results small { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; }
.home-search-empty { margin: 0; padding: 16px; color: var(--muted); font-size: .95rem; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.home-tools {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: 0 var(--gutter);
}
.home-tools ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.tool-card {
    padding: 22px 22px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}
.tool-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.tool-name {
    margin: 0 0 4px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}
.tool-card h3 { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.3; letter-spacing: -.01em; }
.tool-card p:last-child { margin: 0; color: var(--muted); font-size: .975rem; }

.home-section {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: clamp(56px, 7vw, 88px) var(--gutter) 0;
    scroll-margin-top: 16px;
}
.home-section:last-child { padding-bottom: 72px; }

.section-head { max-width: 640px; margin: 0 auto 32px; text-align: center; }
.section-head h2,
.prose h2 {
    margin: 0;
    font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -.02em;
}
.section-head p { margin: 12px 0 0; color: var(--muted); }

.program-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.program-card {
    padding: 20px 20px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color .15s;
}
.program-card:hover { border-color: var(--line-strong); }
.program-card h3 { margin: 0; font-size: 1.1rem; letter-spacing: -.01em; }
.program-card nav { display: flex; flex-direction: column; margin-top: 6px; }
.program-card nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    color: var(--ink-2);
    font-size: .975rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.program-card nav a:last-child { border-bottom: 0; }
.program-card nav a svg { color: var(--faint); transition: transform .15s, color .15s; }
.program-card nav a:hover { color: var(--accent-ink); }
.program-card nav a:hover svg { color: var(--accent); transform: translateX(3px); }

/* ── Program hub (program.php) ───────────────────────────────────────────── */

.hub-tools {
    list-style: none;
    margin: 0 0 40px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.hub-tools li { display: flex; }
.tool-card--link {
    display: flex;
    flex-direction: column;
    width: 100%;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}
.tool-card--link:hover { border-color: var(--accent); background: var(--surface); }
.tool-card--link .tool-question { margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.tool-card--link .tool-blurb { color: var(--muted); font-size: .975rem; }

.hub-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.hub-panel {
    padding: 22px 24px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.hub-panel h2 { margin: 0 0 12px; font-size: 1.25rem; letter-spacing: -.01em; }

.hub-facts { margin: 0; }
.hub-facts > div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 4px 16px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}
.hub-facts dt { color: var(--muted); font-size: .925rem; font-weight: 600; }
.hub-facts dd { margin: 0; color: var(--ink); }
.hub-facts dd span { display: block; color: var(--faint); font-size: .9rem; }

.hub-offers { list-style: none; margin: 0; padding: 0; }
.hub-offers li { padding: 11px 0; border-top: 1px solid var(--line); }
.hub-offers a { color: var(--ink); font-weight: 600; text-decoration: none; }
.hub-offers a:hover { color: var(--accent-ink); text-decoration: underline; }
.hub-offers span { display: block; margin-top: 2px; color: var(--faint); font-size: .9rem; }
.hub-empty { margin: 0; color: var(--muted); }
.hub-more { margin: 14px 0 0; }
.hub-more a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.hub-more a:hover { text-decoration: underline; }

.hub-note { max-width: 720px; margin: 32px 0 0; color: var(--faint); font-size: .925rem; }

.program-card h3 a { color: inherit; text-decoration: none; }
.program-card h3 a:hover { color: var(--accent-ink); text-decoration: underline; }

@media (max-width: 1040px) {
    .hub-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .hub-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .hub-tools { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .hub-panel { padding: 18px 16px 20px; }
    .hub-facts > div { grid-template-columns: minmax(0, 1fr); }
}

/* ── Tool index pages (tool.php: /earn, /compare, /value) ────────────────── */

.index-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}
.index-card {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.index-card svg { flex: none; color: var(--faint); transition: transform .15s, color .15s; }
.index-card:hover { border-color: var(--accent); color: var(--accent-ink); }
.index-card:hover svg { color: var(--accent); transform: translateX(3px); }

.index-section { max-width: 820px; margin-top: 48px; color: var(--ink-2); }
.index-section h2 { margin: 0 0 10px; font-size: 1.35rem; letter-spacing: -.01em; color: var(--ink); }
.index-section p { margin: 0; line-height: 1.7; }
.index-section p + p { margin-top: 14px; }

.index-table-wrap { margin-top: 20px; overflow-x: auto; }
.index-table { width: 100%; border-collapse: collapse; font-size: .975rem; }
.index-table th, .index-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.index-table thead th {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom-color: var(--line-strong);
}
.index-table tbody th { font-weight: 600; }
.index-table tbody th a { color: var(--ink); text-decoration: none; }
.index-table tbody th a:hover { color: var(--accent-ink); text-decoration: underline; }
.index-table td span { color: var(--faint); font-size: .9rem; }
.index-section .index-note { margin-top: 14px; color: var(--faint); font-size: .925rem; }

@media (max-width: 560px) {
    .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .index-card { padding: 12px 12px 12px 14px; font-size: .95rem; line-height: 1.3; }
}

.home-tools li { display: flex; }
.home-tools .tool-card--link { background: var(--surface-alt); }

.prose { max-width: calc(680px + 2 * var(--gutter)); color: var(--ink-2); }
.prose h2 { margin-bottom: 16px; color: var(--ink); }
.prose p { margin: 0; line-height: 1.7; }
.prose p + p { margin-top: 14px; }
.prose p + h2 { margin-top: 48px; }
.prose-note {
    margin-top: 40px !important;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: .925rem;
    color: var(--muted);
}

@media (max-width: 960px) {
    .home-tools ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .hero, .home-tools, .home-section { padding-inline: 16px; }
    .home-tools ul { grid-template-columns: minmax(0, 1fr); }
    .hero-picker .select, .hero-picker .btn { flex: 1 1 100%; min-width: 0; height: 48px; }
}

/* ── Back to top ─────────────────────────────────────────────────────────── */

html { scroll-behavior: smooth; }

.back-to-top-wrap {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: 0 var(--gutter) 24px;
    display: flex;
    justify-content: flex-end;
}
.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: .95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.back-to-top:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
    background: var(--surface-alt);
    border-top: 1px solid var(--line);
    color: var(--muted);
}
.site-footer-inner {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: 48px var(--gutter) 40px;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 32px;
    font-size: .95rem;
}
.footer-brand p { max-width: 240px; margin: 14px 0 0; line-height: 1.55; }
.footer-group h2 {
    margin: 0 0 14px;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
}
.footer-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-group a { color: var(--muted); text-decoration: none; }
.footer-group a:hover { color: var(--accent-ink); text-decoration: underline; }

.footer-bottom {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: 20px var(--gutter) 28px;
    border-top: 1px solid var(--line);
    font-size: .95rem;
}
.footer-bottom p { margin: 0; }

/* ── Tablet: result panel drops below the fields ─────────────────────────── */

@media (max-width: 960px) {
    .help { max-width: none; }
    .site-footer-inner { grid-template-columns: repeat(3, 1fr); }
    .footer-brand { grid-column: 1 / -1; }
    .calc { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .calc-side { position: static; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

/* Top nav collapses into the menu button below 860px (six items don't fit) */
@media (max-width: 860px) {
    .menu-btn { display: grid; }
    .topnav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 12px 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgb(15 23 42 / .08);
    }
    .topbar.menu-open .topnav { display: flex; }
    .topnav a, .nav-menu-btn { padding: 12px; border-radius: 10px; font-size: 1.0625rem; }
    .nav-menu-btn { width: 100%; justify-content: space-between; }
    .nav-menu-panel {
        position: static;
        width: auto;
        margin: 2px 0 6px;
        padding: 4px 0 4px 12px;
        border: 0;
        border-left: 2px solid var(--line);
        border-radius: 0;
        box-shadow: none;
    }
    .nav-menu-panel a { padding: 9px 12px; font-size: 1rem; white-space: normal; }
}

@media (max-width: 640px) {
    .topbar-inner { height: 56px; padding: 0 8px 0 16px; }
    .topnav { max-height: calc(100vh - 56px); }


    .page { padding: 20px 16px 48px; }
    .page-head { margin-bottom: 20px; }

    /* Fields become a flat list: label above control, no card chrome */
    .calc-fields {
        border-radius: 0;
        border-inline: 0;
        box-shadow: none;
        margin-inline: -16px;
    }
    .field {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 16px;
    }
    .field-label { padding-top: 0; font-size: 1rem; }

    .input,
    .select,
    .select--wide { width: 100%; min-width: 0; height: 48px; }
    .inline > .input { flex: 1 1 140px; width: auto; }
    /* Nights, extra points and point values hold a few digits — no need to span the row */
    .input--short { width: 140px; }
    /* Points + Cash: both short numbers share one line, the hint/min note wrap below */
    .inline--pair { flex-wrap: wrap; gap: 6px 8px; }
    .inline--pair > .input { flex: 1 1 0; min-width: 0; }
    .inline--pair > .hint, .inline--pair > .note { flex-basis: 100%; }
    /* Buy Points: one line each for price and balance, units never wrap off on their
       own; the price is a few characters, so its field stays short */
    .buy-points > .inline { flex: 1 1 100%; flex-wrap: nowrap; min-width: 0; }
    .buy-points > .inline > .input { flex: 1 1 0; width: 0; min-width: 0; }
    .buy-points > .inline > #buy_price { flex: 0 1 110px; }
    .buy-points .unit { white-space: nowrap; }
    .custom-offer-row .select { flex: 1 1 100%; }
    /* The amount is a few digits: cap it like the other short fields, and let it shrink
       before the unit ("× base points", GHA's "× D$ (base + status)") breaks onto two lines */
    .custom-offer-row .input  { flex: 0 1 140px; width: auto; min-width: 72px; }
    .custom-offer-suffix { white-space: nowrap; flex-shrink: 0; }

    .choice { padding: 8px 0; }
    .promo-body .choice { padding: 10px 8px; }
    .promo-head { padding: 12px 14px; flex-wrap: wrap; }
    .promo-toggle { flex-basis: 100%; }
    .promo-toggle + * { margin-left: 24px; }
    .promo-body { padding: 0 14px 10px; }
    .promo-meta, .promo-deadline, .promo-closed { margin-left: 0; }

    .calc-result { padding: 20px 16px; }
    .result-actions .btn-primary { height: 48px; }

    .help { margin-top: 40px; }
    .help > div { grid-template-columns: minmax(0, 1fr); padding: 16px 0; }
    .help h3 { grid-row: auto; margin-bottom: 4px; }
    .help > div > :not(h3) { grid-column: 1; }

    .site-footer-inner { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding: 32px 16px 28px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { padding: 18px 16px 24px; }
    .back-to-top-wrap { padding: 0 16px 20px; justify-content: center; }
}

/* Calculate / Compare button: the headline figures settle in with a soft highlight so
   it is clear they were just recalculated (added by flashResults() in hotelcalc.js).
   The highlight is painted with box-shadow + background so nothing shifts layout. */
@keyframes result-refresh {
    0%   { opacity: .35; transform: translateY(3px);
           background-color: var(--accent-soft); box-shadow: 0 0 0 5px var(--accent-soft); }
    35%  { opacity: 1; transform: none;
           background-color: var(--accent-soft); box-shadow: 0 0 0 5px var(--accent-soft); }
    100% { opacity: 1; transform: none;
           background-color: transparent; box-shadow: 0 0 0 5px transparent; }
}
@keyframes result-refresh-still {
    0%, 35% { background-color: var(--accent-soft); box-shadow: 0 0 0 5px var(--accent-soft); }
    100%    { background-color: transparent; box-shadow: 0 0 0 5px transparent; }
}
.is-refreshed {
    border-radius: 6px;
    animation: result-refresh .9s ease-out;
}
.compare-hero-value.is-refreshed { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    .is-refreshed { animation-name: result-refresh-still; }
}

/* --------------------------------------------------------------------------
   Saved settings page (settings.php): rows built by its inline script
   -------------------------------------------------------------------------- */
.settings { margin-top: 32px; }
.settings-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-strong);
}
.settings-count { margin: 0; color: var(--muted); }
.btn--sm { height: 38px; padding: 0 16px; font-size: .95rem; }

.settings-section { margin-top: 28px; }
.settings-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.settings-section h2 { margin: 0; font-size: 1.125rem; color: var(--ink); }
.settings-note { margin: 6px 0 0; color: var(--faint); font-size: .925rem; }

.settings-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.setting {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 8rem;   /* fixed actions column keeps values aligned across sections */
    align-items: center;
    gap: 6px 16px;
    min-height: 52px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.setting-name { color: var(--muted); }
.setting-value { color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.setting-value .input { width: 110px; flex: none; font-weight: 400; }
.setting-unit { color: var(--muted); font-weight: 400; }
.setting-actions { display: flex; align-items: center; gap: 16px; justify-self: end; }

.link-button {
    font: inherit;
    color: var(--accent);
    background: none;
    border: 0;
    padding: 4px 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.link-button:hover { color: var(--accent-ink); }
.link-button:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

.settings-empty {
    margin-top: 32px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--muted);
}

@media (max-width: 560px) {
    .setting { grid-template-columns: minmax(0, 1fr) auto; }
    .setting-actions { justify-self: end; }
    .setting-name { grid-column: 1 / -1; font-size: .9rem; }
}
