/* Virtual Scalper — pastel glass system (light) with a dark teal counterpart.
   Translucency is decorative only: text always sits on a panel of at least ~85% opacity. */
:root {
  --ink: #12232a;
  --muted: #4b5f67;
  --label: #34474f;
  --bg-base: #eaf1f8;
  --bg-blue: #cfe2f6;
  --bg-mint: #cdf1e4;
  --bg-lilac: #e3daf5;
  --glass: rgb(255 255 255 / 58%);
  --glass-strong: rgb(255 255 255 / 86%);
  --glass-border: rgb(255 255 255 / 78%);
  --surface: rgb(255 255 255 / 90%);
  --surface-strong: #ffffff;
  --surface-sunken: #eef4f6;
  --line: #d3dfe4;
  --field-line: #b5c7cf;
  --accent: #0f766e;
  --accent-dark: #0b5a54;
  --accent-soft: #d7f4ec;
  --accent-contrast: #ffffff;
  --mint: #8fe3cb;
  --warning: #7a4a06;
  --warning-soft: #fff2cf;
  --warning-line: #e6c783;
  --danger: #962f2f;
  --danger-soft: #fdeaea;
  --danger-line: #e7b7b4;
  --success-soft: #e3f6ee;
  --success-line: #98cdb8;
  --focus: #1d4ed8;
  --header-bg: rgb(236 244 250 / 72%);
  --nav-active: rgb(143 227 203 / 45%);
  --shadow: 0 18px 44px rgb(46 72 102 / 12%);
  --shadow-soft: 0 8px 24px rgb(46 72 102 / 8%);
  --radius-sm: .7rem;
  --radius: 1.1rem;
  --radius-lg: 1.6rem;
  --pill: 999px;
  --bottom-bar-space: 0px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-base);
  line-height: 1.5;
  color-scheme: light;
}

/* Dark teal variant: explicit choice, or system preference when no choice is stored. */
:root[data-theme="dark"] {
  --ink: #e4f2f0;
  --muted: #a9c0c0;
  --label: #c3d6d5;
  --bg-base: #0b1c21;
  --bg-blue: #10324a;
  --bg-mint: #0f3b36;
  --bg-lilac: #2a2446;
  --glass: rgb(18 44 50 / 62%);
  --glass-strong: rgb(16 38 44 / 90%);
  --glass-border: rgb(150 220 210 / 16%);
  --surface: rgb(17 40 46 / 94%);
  --surface-strong: #15343b;
  --surface-sunken: #0f2a30;
  --line: #28474d;
  --field-line: #3f6269;
  --accent: #5fd8c2;
  --accent-dark: #8ce9d7;
  --accent-soft: #123f3a;
  --accent-contrast: #05292a;
  --mint: #5fd8c2;
  --warning: #f3d38b;
  --warning-soft: #3a3014;
  --warning-line: #6b5720;
  --danger: #ffb8b3;
  --danger-soft: #3d1f22;
  --danger-line: #6c3438;
  --success-soft: #123a33;
  --success-line: #2f6b5e;
  --focus: #ffd166;
  --header-bg: rgb(11 30 35 / 78%);
  --nav-active: rgb(95 216 194 / 20%);
  --shadow: 0 18px 44px rgb(0 0 0 / 38%);
  --shadow-soft: 0 8px 24px rgb(0 0 0 / 26%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e4f2f0;
    --muted: #a9c0c0;
    --label: #c3d6d5;
    --bg-base: #0b1c21;
    --bg-blue: #10324a;
    --bg-mint: #0f3b36;
    --bg-lilac: #2a2446;
    --glass: rgb(18 44 50 / 62%);
    --glass-strong: rgb(16 38 44 / 90%);
    --glass-border: rgb(150 220 210 / 16%);
    --surface: rgb(17 40 46 / 94%);
    --surface-strong: #15343b;
    --surface-sunken: #0f2a30;
    --line: #28474d;
    --field-line: #3f6269;
    --accent: #5fd8c2;
    --accent-dark: #8ce9d7;
    --accent-soft: #123f3a;
    --accent-contrast: #05292a;
    --mint: #5fd8c2;
    --warning: #f3d38b;
    --warning-soft: #3a3014;
    --warning-line: #6b5720;
    --danger: #ffb8b3;
    --danger-soft: #3d1f22;
    --danger-line: #6c3438;
    --success-soft: #123a33;
    --success-line: #2f6b5e;
    --focus: #ffd166;
    --header-bg: rgb(11 30 35 / 78%);
    --nav-active: rgb(95 216 194 / 20%);
    --shadow: 0 18px 44px rgb(0 0 0 / 38%);
    --shadow-soft: 0 8px 24px rgb(0 0 0 / 26%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(60rem 40rem at 0% 0%, var(--bg-blue), transparent 70%),
    radial-gradient(50rem 40rem at 100% 10%, var(--bg-mint), transparent 70%),
    radial-gradient(60rem 45rem at 60% 100%, var(--bg-lilac), transparent 70%),
    var(--bg-base);
  background-attachment: fixed;
  color: var(--ink);
}
a { color: var(--accent-dark); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .35rem; }
[hidden] { display: none !important; }
h1, h2, h3 { letter-spacing: -.02em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: .5rem;
  transform: translateY(-200%);
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg-base);
}
.skip-link:focus { transform: translateY(0); }

.environment-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .2rem .65rem;
  padding: .45rem 1rem;
  background: var(--warning-soft);
  color: var(--warning);
  border-bottom: 1px solid var(--warning-line);
  font-size: .82rem;
  text-align: center;
}

/* Shell: glass header, pill navigation, floating bottom bar on phones. */
.site-header {
  min-height: 4.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: var(--header-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 6px 24px rgb(46 72 102 / 6%);
  position: sticky;
  top: 0;
  z-index: 20;
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}
.wordmark { min-width: 0; display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-weight: 780; letter-spacing: -.02em; }
.wordmark:hover { color: var(--ink); }
.wordmark-mark { flex: 0 0 auto; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .8rem; background: linear-gradient(135deg, var(--mint), #9ec9f0 60%, #c7b6ef); color: #0b2e2c; font-size: .72rem; font-weight: 900; letter-spacing: .06em; box-shadow: inset 0 1px 0 rgb(255 255 255 / 60%); }
.wordmark-copy { min-width: 0; display: grid; line-height: 1.1; }
.wordmark-copy strong { font-size: 1.02rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wordmark-copy small { margin-top: .2rem; color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.primary-nav { justify-self: center; display: flex; align-items: center; gap: .25rem; padding: .3rem; border: 1px solid var(--glass-border); border-radius: var(--pill); background: var(--glass); }
.primary-nav a { min-height: 2.6rem; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; border-radius: var(--pill); color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 700; white-space: nowrap; }
.primary-nav a:hover { color: var(--ink); background: var(--glass-strong); }
.primary-nav a[aria-current="page"] { background: var(--nav-active); color: var(--ink); box-shadow: inset 0 0 0 1px rgb(15 118 110 / 22%); }
.nav-icon, .meta-icon, .search-icon, .icon-button svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.member-tools { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; }
.member-tools form { margin: 0; }
.allowance-pill { padding: .42rem .75rem; border: 1px solid var(--glass-border); border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-dark); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.icon-button { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; padding: 0; border: 1px solid var(--glass-border); border-radius: 50%; background: var(--glass-strong); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-soft); }
.icon-button:hover { background: var(--surface-strong); }
.theme-icon-light { display: none; }
.theme-toggle[aria-pressed="true"] .theme-icon-dark { display: none; }
.theme-toggle[aria-pressed="true"] .theme-icon-light { display: block; }
.text-button { min-height: 2.6rem; padding: .4rem .6rem; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.text-button:hover { color: var(--ink); background: var(--glass); }

main { min-height: calc(100vh - 11rem); }
.page-shell { width: min(1280px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 0 4rem; }
.page-heading { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 22rem); gap: 1.5rem 2rem; align-items: end; margin-bottom: 1.5rem; }
.page-heading h1, .detail-card h1, .auth-copy h1 { margin: .15rem 0 .5rem; font-weight: 780; letter-spacing: -.035em; line-height: 1.05; }
.page-heading h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.page-heading > div > p:last-child { max-width: 42rem; margin: 0; color: var(--muted); font-size: 1rem; }
.eyebrow { margin: 0 0 .45rem; color: var(--accent-dark); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* Reusable glass panel surface. */
.allowance-card, .filter-panel, .listing-card, .image-panel, .detail-card, .detail-section, .claim-row,
.auth-card, .session-card, .security-card, .operator-card, .passkey-actions, .device-list li, .operator-audit-list li, .operator-mode, .table-scroll {
  border: 1px solid var(--glass-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.allowance-card { padding: 1rem 1.15rem; border-radius: var(--radius); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.allowance-card .eyebrow { margin-bottom: .2rem; }
.allowance-number { display: flex; align-items: baseline; gap: .3rem; margin: 0; }
.allowance-number strong { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.allowance-number span, .allowance-card > p { color: var(--muted); }
.allowance-card > p { margin: .6rem 0 0; font-size: .78rem; }
.allowance-progress { width: 100%; height: .45rem; display: block; margin-top: .75rem; border: 0; border-radius: var(--pill); overflow: hidden; background: var(--surface-sunken); color: var(--accent); }
.allowance-progress::-webkit-progress-bar { border-radius: var(--pill); background: var(--surface-sunken); }
.allowance-progress::-webkit-progress-value { border-radius: var(--pill); background: linear-gradient(90deg, var(--accent), var(--mint)); }
.allowance-progress::-moz-progress-bar { border-radius: var(--pill); background: var(--accent); }

/* Feed controls. */
.feed-tabs { width: fit-content; max-width: 100%; display: flex; gap: .25rem; margin-bottom: 1rem; padding: .3rem; border: 1px solid var(--glass-border); border-radius: var(--pill); background: var(--glass); }
.feed-tabs a { min-height: 2.75rem; display: flex; align-items: center; gap: .5rem; padding: .45rem 1.1rem; border-radius: var(--pill); color: var(--muted); text-decoration: none; font-weight: 750; white-space: nowrap; }
.feed-tabs small { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.feed-tabs a:hover { color: var(--ink); background: var(--glass-strong); }
.feed-tabs a[aria-current="page"] { background: var(--surface-strong); color: var(--ink); box-shadow: var(--shadow-soft), inset 0 0 0 1px rgb(15 118 110 / 24%); }
.filter-panel { display: grid; grid-template-columns: minmax(14rem, 2fr) minmax(12rem, 1.1fr) auto; gap: .85rem; align-items: end; padding: 1rem; border-radius: var(--radius-lg); background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.filter-panel-high { grid-template-columns: minmax(14rem, 2fr) minmax(12rem, 1.1fr) repeat(2, minmax(7.5rem, .7fr)) auto; }
.filter-actions { display: flex; align-items: center; gap: .5rem; }
.field { min-width: 0; display: grid; gap: .35rem; }
.field label { font-size: .76rem; font-weight: 750; color: var(--label); }
.field input, .field select, .field textarea { width: 100%; min-height: 2.85rem; padding: .6rem .8rem; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--surface-strong); color: var(--ink); }
.field select { border-radius: var(--pill); padding-inline: 1rem; }
.field input:hover, .field select:hover { border-color: var(--accent); }
.search-field { position: relative; }
.search-field .search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { min-height: 3rem; padding-left: 2.75rem; border-radius: var(--pill); background: var(--surface-strong); box-shadow: inset 0 1px 2px rgb(46 72 102 / 6%); }
.field-error { display: grid; gap: .2rem; color: var(--danger); font-size: .78rem; font-weight: 650; }
.clear-link { min-height: 2.85rem; display: grid; place-items: center; padding: .5rem .8rem; border-radius: var(--pill); font-size: .87rem; font-weight: 700; }

.button { min-height: 2.85rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.15rem; border: 1px solid transparent; border-radius: var(--pill); text-decoration: none; font-weight: 750; text-align: center; cursor: pointer; transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 8px 20px rgb(15 118 110 / 24%); }
.button-primary:hover { background: var(--accent-dark); color: var(--accent-contrast); }
.button-primary:disabled, .button[aria-disabled="true"] { background: var(--surface-sunken); color: var(--muted); border-color: var(--line); box-shadow: none; cursor: not-allowed; transform: none; }
.button-secondary { border-color: var(--field-line); background: var(--surface-strong); color: var(--ink); }
.button-secondary:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.button-danger { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.button-wide { width: 100%; }

/* Results header and source health. */
.source-health { display: flex; align-items: flex-start; gap: .65rem; margin: 1rem 0 0; padding: .7rem 1rem; border-radius: var(--radius); font-size: .84rem; }
.source-health.helper { border: 1px solid var(--success-line); background: var(--success-soft); color: var(--ink); }
.source-health-copy { min-width: 0; }
.source-health-copy .helper { display: block; margin: .15rem 0 0; }
.source-health-dot { width: .6rem; height: .6rem; flex: 0 0 auto; margin-top: .4rem; border-radius: 50%; background: var(--warning); }
.source-health-healthy .source-health-dot { background: var(--accent); box-shadow: 0 0 0 4px rgb(15 118 110 / 15%); }
.source-health-outage .source-health-dot { background: var(--danger); }
.result-summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.2rem .1rem 1rem; color: var(--muted); font-size: .84rem; }
.result-summary p { margin: 0; }
.result-count { display: inline-grid; place-items: center; min-width: 2rem; height: 1.75rem; margin-right: .3rem; padding: 0 .55rem; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }
.feed-update-tools { min-height: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: .9rem 0 0; }
.feed-update-tools p { margin: 0; color: var(--muted); font-size: .84rem; }
.feed-update-tools p:empty { display: none; }

/* Listing cards: large inset photo, overlay chips, compact body, source row. */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr)); gap: 1.1rem; }
.listing-card { position: relative; min-width: 0; display: flex; flex-direction: column; padding: .55rem; border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: settle-in 260ms both ease-out; }
.card-media { position: relative; }
.card-thumbnail { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border-radius: calc(var(--radius-lg) - .4rem); background: linear-gradient(145deg, var(--bg-blue), var(--surface-sunken) 52%, var(--bg-lilac)); color: var(--muted); text-decoration: none; }
.card-thumbnail img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; transition: transform 300ms ease; }
.card-thumbnail:hover img { transform: scale(1.03); }
.card-thumbnail > span { font-size: .8rem; font-weight: 680; }
.thumbnail-empty { display: grid; place-items: center; gap: .2rem; padding: 1rem; text-align: center; }
.thumbnail-empty > span { color: var(--accent); font-size: 2.2rem; line-height: 1; }
.thumbnail-empty strong { color: var(--ink); }
.thumbnail-empty small { max-width: 14rem; color: var(--muted); font-weight: 500; }
.media-chip { position: absolute; display: inline-flex; align-items: center; max-width: calc(100% - 1.5rem); padding: .3rem .65rem; border: 1px solid rgb(255 255 255 / 60%); border-radius: var(--pill); background: rgb(255 255 255 / 88%); color: #12232a; font-size: .72rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.media-chip-time { left: .6rem; bottom: .6rem; }
.media-chip-free { right: .6rem; top: .6rem; background: #d7f4ec; color: #0b4f49; border-color: #aee6d6; }
.media-chip-photos { left: .6rem; top: .6rem; max-width: calc(50% - 1rem); }
.card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; padding: .85rem .6rem .35rem; }
.listing-card:nth-child(4n+2) { animation-delay: 35ms; }
.listing-card:nth-child(4n+3) { animation-delay: 70ms; }
.listing-card:nth-child(4n+4) { animation-delay: 105ms; }
.listing-card h2 { margin: .45rem 0 .3rem; font-size: 1.08rem; line-height: 1.3; font-weight: 760; overflow-wrap: anywhere; }
/* Very long source titles: clamp on cards only; the full title stays in the DOM and on the detail page. */
.listing-card h2 a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.listing-card h2 a { color: var(--ink); text-decoration: none; }
.listing-card h2 a:hover { color: var(--accent-dark); text-decoration: underline; }
.listing-card-stale { opacity: .92; }
.listing-card-stale .card-thumbnail img { filter: grayscale(.85); }
.listing-card-stale [data-listing-link] { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.listing-status { margin: .5rem .6rem .35rem; padding: .55rem .7rem; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: .8rem; font-weight: 720; }
.card-topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .75rem; color: var(--muted); font-size: .74rem; }
.source-badge { display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-dark); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.listing-meta { display: flex; flex-wrap: wrap; gap: .15rem .9rem; margin: 0; color: var(--muted); font-size: .82rem; }
.meta-location { min-width: 0; display: inline-flex; align-items: center; gap: .25rem; overflow-wrap: anywhere; }
.meta-icon { width: .95rem; height: .95rem; }
.card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin-top: auto; padding-top: .9rem; }
.card-footer .button { min-height: 2.6rem; padding-block: .45rem; font-size: .88rem; }
.source-link { display: flex; justify-content: space-between; align-items: center; gap: .7rem; min-height: 2.9rem; margin: .5rem 0 0; padding: .55rem .85rem; border-top: 1px solid var(--line); border-radius: 0 0 calc(var(--radius-lg) - .4rem) calc(var(--radius-lg) - .4rem); color: var(--muted); font-size: .78rem; font-weight: 720; text-decoration: none; }
.source-link:hover { background: var(--accent-soft); color: var(--accent-dark); }
.source-link-inline { display: inline-flex; justify-content: flex-start; min-height: 2.75rem; margin: .2rem 0 0; padding: 0; border: 0; background: transparent; color: var(--accent-dark); }
.source-link-inline:hover { background: transparent; text-decoration: underline; }
.price { margin: 0; color: var(--ink); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.price span { color: var(--muted); font-size: .95rem; font-weight: 650; letter-spacing: 0; }

.empty-state, .error-state { display: grid; justify-items: center; max-width: 44rem; margin: 2.5rem auto; padding: clamp(1.75rem, 6vw, 3.5rem); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-strong); box-shadow: var(--shadow); text-align: center; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.empty-state h2, .error-state h1 { margin: .8rem 0 .35rem; font-weight: 780; font-size: clamp(1.5rem, 4vw, 2rem); }
.empty-state p, .error-state > p { max-width: 34rem; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 1.1rem; background: linear-gradient(135deg, var(--accent-soft), var(--bg-lilac)); color: var(--accent-dark); font-size: 1.2rem; font-weight: 850; }
.error-state .error-code { margin: 0; color: var(--danger); font-weight: 900; letter-spacing: .15em; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: .65rem; }
.error-actions form { margin: 0; }
.pagination { width: fit-content; max-width: 100%; display: flex; justify-content: center; align-items: center; gap: .4rem; margin: 2rem auto 0; padding: .3rem; border: 1px solid var(--glass-border); border-radius: var(--pill); background: var(--glass-strong); }
.pagination a, .pagination > span { min-height: 2.75rem; display: grid; place-items: center; padding: .5rem .9rem; border-radius: var(--pill); font-weight: 700; }
.pagination a { text-decoration: none; }
.pagination a:hover { background: var(--accent-soft); }
.pagination > span:not([aria-disabled]) { color: var(--muted); font-weight: 600; }
.pagination [aria-disabled="true"] { color: var(--muted); opacity: .6; }

/* Listing detail. */
.detail-shell { padding-top: 1.5rem; }
.back-link { min-height: 2.75rem; display: inline-flex; align-items: center; margin-bottom: 1rem; padding: .35rem .9rem; border: 1px solid var(--glass-border); border-radius: var(--pill); background: var(--glass); color: var(--ink); font-weight: 700; text-decoration: none; }
.back-link:hover { background: var(--glass-strong); color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(21rem, .85fr); gap: 1.25rem; align-items: start; }
.detail-media { min-width: 0; display: grid; gap: 1.25rem; }
.image-panel, .detail-card { overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.image-panel { min-width: 0; display: grid; padding: .55rem; }
/* Photo stage: the whole photo is always visible (contain), never cropped on detail. */
.gallery { min-width: 0; display: grid; gap: .55rem; }
.gallery-stage { position: relative; height: clamp(18rem, 62vh, 40rem); overflow: hidden; border-radius: calc(var(--radius-lg) - .4rem); background: var(--surface-sunken); }
.gallery-main { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.gallery-step { position: absolute; top: 50%; z-index: 1; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; padding: 0; border: 1px solid rgb(255 255 255 / 70%); border-radius: 50%; background: rgb(255 255 255 / 90%); color: #12232a; cursor: pointer; box-shadow: var(--shadow-soft); transform: translateY(-50%); }
.gallery-step:hover { background: #ffffff; }
.gallery-step svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gallery-prev { left: .6rem; }
.gallery-next { right: .6rem; }
.gallery-count { right: .6rem; bottom: .6rem; }
.gallery-thumbs { min-width: 0; display: flex; gap: .5rem; margin: 0; padding: .3rem; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.gallery-thumbs li { flex: 0 0 auto; scroll-snap-align: start; }
.gallery-thumb { width: 4.6rem; height: 3.45rem; display: block; overflow: hidden; border: 2px solid transparent; border-radius: .75rem; background: var(--surface-sunken); opacity: .72; }
.gallery-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb:focus-visible { outline-offset: 1px; opacity: 1; }
.gallery-thumb[aria-current="true"] { border-color: var(--accent); opacity: 1; box-shadow: 0 0 0 2px var(--accent-soft); }
.image-fallback { width: 100%; height: 100%; min-height: 18rem; display: grid; place-content: center; justify-items: center; padding: 2rem; border-radius: calc(var(--radius-lg) - .4rem); background: linear-gradient(145deg, var(--bg-blue), var(--surface-sunken) 52%, var(--bg-lilac)); text-align: center; }
.image-fallback > span { font-size: 4.5rem; line-height: 1; color: var(--accent); }
.image-fallback strong { margin-top: 1rem; font-size: 1.4rem; }
.image-fallback p { max-width: 22rem; color: var(--muted); }
.detail-card { padding: clamp(1.25rem, 3.5vw, 2rem); }
.detail-card h1 { margin-top: 1rem; font-size: clamp(1.7rem, 3.2vw, 2.5rem); overflow-wrap: anywhere; }
.detail-price { margin: .75rem 0 1.25rem; font-size: 2rem; font-weight: 820; letter-spacing: -.03em; }
.detail-price small { display: block; margin-top: .1rem; color: var(--muted); font-size: .73rem; font-weight: 650; letter-spacing: 0; }
.facts { margin: 0; border-block: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border: 0; }
.facts dt { color: var(--muted); font-size: .82rem; }
.facts dd { min-width: 0; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.facts dd span { color: var(--muted); font-weight: 450; }
.facts-compact div { padding: .55rem 0; }
.detail-section { min-width: 0; padding: 1.1rem 1.25rem; border-radius: var(--radius); }
.detail-card .detail-section { margin-top: 1.1rem; padding: 0; border: 0; background: transparent; box-shadow: none; }
.detail-section h2 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 780; }
.description-text { max-width: 70ch; margin: 0; font-size: 1rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
/* Missing information reads as "not captured", visually quieter than real data. */
.missing-value { color: var(--muted); font-weight: 500; font-style: italic; }
.facts dd .missing-value { font-weight: 500; }
.missing-note, .contact-fallback { margin: 0; color: var(--muted); font-size: .9rem; }
.contact-fallback { margin-top: .75rem; padding: .75rem .9rem; border: 1px dashed var(--field-line); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--label); }
.seller-panel .helper { margin-top: .6rem; }
.contact-value { display: inline-flex; align-items: center; min-height: 2.75rem; overflow-wrap: anywhere; }
.contact-source-button { margin-top: .75rem; }
.claim-history-list { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .88rem; }
.notice { margin-top: 1.1rem; padding: .85rem 1rem; border: 1px solid var(--warning-line); border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); }
.notice p { margin: .2rem 0 0; color: var(--warning); font-size: .85rem; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.2rem; }
.detail-actions form, .detail-actions form .button { width: 100%; }
.claim-note { margin-bottom: 0; padding-top: .85rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.claim-note strong { color: var(--ink); }
.claim-preflight-status { grid-column: 1 / -1; order: 3; margin: 0; color: var(--muted); font-size: .8rem; }
.detail-actions > a { order: 2; }
.detail-actions > form { order: 1; }

/* My Claims. */
.claims-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(34rem, 100%), 1fr)); gap: 1rem; }
.claim-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.25rem; align-items: center; padding: .7rem 1.1rem .7rem .7rem; border-radius: var(--radius-lg); }
.claim-info { min-width: 0; display: flex; align-items: center; gap: 1rem; }
.claim-copy { min-width: 0; }
.claim-thumbnail { width: 7.5rem; aspect-ratio: 4 / 3; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); background: linear-gradient(145deg, var(--bg-blue), var(--surface-sunken) 52%, var(--bg-lilac)); color: var(--muted); text-decoration: none; }
.claim-thumbnail img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; }
.claim-thumbnail span { padding: .35rem; font-size: .65rem; text-align: center; }
.claim-row h2 { margin: .35rem 0 .15rem; font-size: 1.05rem; font-weight: 760; overflow-wrap: anywhere; }
.claim-row h2 a { color: var(--ink); text-decoration: none; }
.claim-row h2 a:hover { text-decoration: underline; }
.claim-row p { margin: 0; color: var(--muted); }
.claim-meta { font-size: .82rem; }
.claim-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.claim-row-actions form { margin: 0; }
.claim-row-actions .price { font-size: 1.3rem; }

/* Sign-in and account pages share the same glass language. */
.auth-shell { width: min(1060px, calc(100% - 2rem)); min-height: calc(100vh - 10rem); display: grid; grid-template-columns: 1.05fr .8fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; margin: 0 auto; padding: 3rem 0; }
.auth-copy h1 { max-width: 13ch; font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
.auth-copy > p:not(.eyebrow) { max-width: 36rem; color: var(--muted); font-size: 1.05rem; }
.quiet-list { display: grid; gap: .6rem; padding: 0; list-style: none; color: var(--label); }
.quiet-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; margin-right: .6rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: .75rem; font-weight: 900; }
.auth-card { min-width: 0; padding: clamp(1.3rem, 4vw, 2.1rem); border-radius: var(--radius-lg); background: var(--glass-strong); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.auth-card h1, .auth-card h2 { margin: 0 0 1rem; font-size: 1.65rem; font-weight: 780; line-height: 1.15; overflow-wrap: anywhere; }
.auth-card form { display: grid; gap: 1rem; }
.auth-card > p:not(.eyebrow, .helper) { color: var(--muted); }
.auth-shell-single { grid-template-columns: minmax(0, 34rem); justify-content: center; }
.auth-status-card { display: grid; gap: 1rem; }
.auth-status-card > * { margin-block: 0; }
.auth-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-block: 1rem; }
.auth-secondary-form { margin-top: .8rem; }
.auth-divider { display: flex; align-items: center; gap: .7rem; margin-block: .2rem; color: var(--muted); font-size: .78rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.passkey-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: end; margin-bottom: 1rem; padding: 1rem; border-radius: var(--radius); }
.passkey-actions [data-passkey-status] { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .84rem; }
.auth-flow { max-width: 48rem; }
.auth-card-wide { width: 100%; }
.auth-card-wide > form { margin-top: 1.35rem; }
.setup-steps { display: grid; gap: .65rem; padding-left: 1.4rem; color: var(--label); }
.setup-key-panel { min-width: 0; display: grid; gap: .55rem; margin-block: 1rem 1.25rem; padding: 1rem; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.setup-key { display: block; max-width: 100%; padding: .75rem; border-radius: .5rem; background: var(--surface-strong); color: var(--ink); font-size: clamp(.78rem, 3.3vw, .98rem); letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
.backup-code-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-block: 1.25rem; padding: 0; list-style: none; }
.backup-code-list li { min-width: 0; }
.backup-code-list code { display: block; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-sunken); font-size: 1rem; text-align: center; overflow-wrap: anywhere; user-select: all; }
.helper { margin: 1rem 0 0; color: var(--muted); font-size: .78rem; }
.helper code { padding: .08rem .3rem; border-radius: .25rem; background: var(--surface-sunken); color: var(--ink); }
.form-alert { margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid var(--danger-line); border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); }
.source-health.form-alert { margin-bottom: 0; border-color: var(--warning-line); background: var(--warning-soft); color: var(--warning); }
.source-health-outage.form-alert, .source-health-unknown.form-alert { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.source-health.form-alert .helper { color: inherit; opacity: .9; }
.field-help { color: var(--muted); font-size: .78rem; }
.field-help ul { margin: .35rem 0 0; padding-left: 1.15rem; }

.account-shell { max-width: 980px; }
.account-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.account-heading .button { justify-self: end; }
.account-summary { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: .9rem 1rem; border: 1px solid var(--success-line); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-dark); }
.account-summary span { color: var(--label); font-size: .84rem; text-align: right; }
.session-list { display: grid; gap: .8rem; }
.session-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; border-radius: var(--radius); }
.session-current { border-color: var(--success-line); box-shadow: 0 8px 24px rgb(15 118 110 / 12%); }
.session-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .85rem; background: var(--accent-soft); color: var(--accent-dark); font-size: 1rem; }
.session-copy { min-width: 0; }
.session-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.session-title-line h2, .security-card h2 { margin: 0; font-size: 1.15rem; font-weight: 760; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; min-height: 1.7rem; padding: .2rem .6rem; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-dark); font-size: .72rem; font-weight: 780; white-space: nowrap; }
.status-neutral { background: var(--surface-sunken); color: var(--muted); }
.session-facts { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; margin: .45rem 0 0; color: var(--muted); font-size: .8rem; }
.session-facts div { display: flex; flex-wrap: wrap; gap: .35rem; }
.session-facts dt { font-weight: 740; }
.session-facts dd { margin: 0; }
.session-card form { margin: 0; }
.session-action-form { width: min(17rem, 100%); display: grid; gap: .55rem; }
.compact-field { display: grid; gap: .28rem; }
.compact-field label { color: var(--label); font-size: .74rem; font-weight: 760; }
.compact-field input { width: 100%; min-height: 2.65rem; padding: .55rem .75rem; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--surface-strong); color: var(--ink); }
.compact-empty { margin-block: 1rem; }
.danger-zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); gap: 2rem; align-items: center; margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--danger-line); border-radius: var(--radius); background: var(--danger-soft); }
.danger-zone h2 { margin: 0; font-size: 1.15rem; font-weight: 760; }
.danger-zone p:not(.eyebrow) { margin: .35rem 0 0; color: var(--danger); font-size: .86rem; }
.danger-zone form { display: grid; gap: .55rem; }

.auth-shell-compact { min-height: calc(100vh - 9rem); }
.replace-card { max-width: 34rem; }
.session-choices { display: grid; gap: .65rem; margin: 0; padding: 0; border: 0; }
.session-choices legend { margin-bottom: .25rem; color: var(--label); font-size: .78rem; font-weight: 760; }
.session-choice { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: center; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-strong); cursor: pointer; }
.session-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.session-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px rgb(15 118 110 / 18%); }
.session-choice input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
.session-choice span { min-width: 0; display: grid; }
.session-choice strong { overflow-wrap: anywhere; }
.session-choice small { color: var(--muted); }

.device-list { display: grid; gap: .65rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.device-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: .9rem 1rem; border-radius: var(--radius-sm); }
.device-list span { color: var(--muted); font-size: .84rem; }
.confirm-control { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem; align-items: start; color: var(--danger); font-size: .84rem; font-weight: 650; }
.confirm-control input { width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; accent-color: var(--danger); }

.security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1rem; }
.security-card { display: flex; justify-content: space-between; gap: 1.25rem; align-items: start; min-height: 12rem; padding: 1.4rem; border-radius: var(--radius); }
.security-card p:not(.eyebrow) { color: var(--muted); }
.security-muted { background: var(--surface-sunken); box-shadow: none; }
.account-notice { margin-top: 1rem; }

.message-stack { position: fixed; z-index: 50; right: 1rem; top: 5.5rem; display: grid; gap: .6rem; width: min(26rem, calc(100% - 2rem)); }
.message { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-strong); color: var(--ink); box-shadow: var(--shadow); font-weight: 650; }
.message-success { border-color: var(--success-line); background: var(--success-soft); }
.message-success::before { content: "✓ "; color: var(--accent); font-weight: 900; }
.message-warning { border-color: var(--warning-line); background: var(--warning-soft); color: var(--warning); }
.message-error { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.loading-state { position: fixed; z-index: 60; right: 1rem; bottom: calc(1rem + var(--bottom-bar-space)); display: flex; align-items: center; gap: .65rem; padding: .75rem 1.1rem; border: 1px solid var(--success-line); border-radius: var(--pill); background: var(--surface-strong); color: var(--ink); box-shadow: var(--shadow); font-size: .86rem; font-weight: 650; }
.loading-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--accent); animation: pulse 900ms infinite alternate ease-in-out; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; padding: 1.3rem clamp(1rem, 4vw, 3rem) calc(1.3rem + var(--bottom-bar-space)); border-top: 1px solid var(--glass-border); background: var(--glass); color: var(--muted); font-size: .78rem; }
.site-footer p { margin: 0; }

/* Staff workspace: bounded cards and tables never widen the page. Styling only; structure unchanged. */
.operator-shell { min-width: 0; overflow-x: clip; }
.operator-intro, .operator-mode { margin-bottom: 1rem; }
.operator-mode { padding: .8rem 1rem; border-radius: var(--radius-sm); color: var(--muted); }
.operator-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin: 1.5rem 0 2rem; }
.operator-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); font-weight: 780; letter-spacing: -.035em; }
.operator-heading p { max-width: 44rem; margin: .5rem 0 0; color: var(--muted); }
.operator-section-title { margin: 2rem 0 .8rem; font-weight: 760; }
.operator-grid { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); gap: 1rem; }
.operator-card { min-width: 0; padding: 1.25rem; border-radius: var(--radius); }
.operator-card h3 { margin: .15rem 0 .6rem; overflow-wrap: anywhere; }
.operator-card-compact { min-height: 0; }
.operator-form { min-width: 0; display: grid; gap: .7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.operator-form textarea, .operator-form input:not([type="checkbox"], [type="hidden"]) { width: 100%; max-width: 100%; }
.operator-form-danger { border-top-color: var(--danger-line); }
.operator-session-form { padding: 1rem; border: 1px solid var(--danger-line); border-radius: var(--radius-sm); background: var(--danger-soft); }
.confirm-neutral { color: var(--label); }
.table-scroll { max-width: 100%; overflow-x: auto; border-radius: var(--radius); }
.operator-table { width: 100%; min-width: 46rem; border-collapse: collapse; }
.operator-table th, .operator-table td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.operator-table th { background: var(--surface-sunken); font-size: .78rem; }
.operator-audit-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.operator-audit-list li { min-width: 0; display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm); }
.operator-audit-list span { color: var(--muted); overflow-wrap: anywhere; }
.operator-review, .operator-health { display: grid; gap: .7rem; margin: 0; }
.operator-review div, .operator-health div { min-width: 0; display: grid; grid-template-columns: minmax(8rem, .45fr) minmax(0, 1fr); gap: 1rem; padding: .75rem; border-bottom: 1px solid var(--line); }
.operator-review dd, .operator-health dd { margin: 0; overflow-wrap: anywhere; }

@keyframes settle-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { from { opacity: .45; transform: scale(.8); } to { opacity: 1; transform: scale(1.08); } }

@media (max-width: 1100px) {
  .filter-panel-high { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel-high .filter-keyword { grid-column: 1 / -1; }
  .filter-panel-high .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 980px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; min-width: 0; max-width: 100%; overflow-x: auto; }
  .primary-nav a { flex: 1 0 auto; justify-content: center; }
  .allowance-pill { display: none; }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-keyword, .filter-actions { grid-column: 1 / -1; }
  .filter-actions { justify-content: flex-end; }
  .detail-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .session-card { grid-template-columns: auto minmax(0, 1fr); }
  .session-card form { grid-column: 2; }
  .danger-zone { grid-template-columns: 1fr; gap: 1rem; }
}

/* Phones: member navigation floats as a rounded glass bottom bar (video frames 1–10). */
@media (max-width: 760px) {
  body.has-member-nav { --bottom-bar-space: 5.75rem; }
  /* A filtered ancestor captures position:fixed descendants. Keep the floating
     nav viewport-bound rather than covering the header's theme/sign-out tools. */
  .has-member-nav .site-header { grid-template-columns: minmax(0, 1fr) auto; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-strong); }
  .member-nav {
    position: fixed;
    z-index: 40;
    left: max(.6rem, env(safe-area-inset-left));
    right: max(.6rem, env(safe-area-inset-right));
    bottom: max(.6rem, env(safe-area-inset-bottom));
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .2rem;
    max-width: 30rem;
    margin: 0 auto;
    padding: .35rem;
    overflow: visible;
    border-radius: 1.5rem;
    background: var(--glass-strong);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
  }
  .member-nav a { min-width: 0; min-height: 3.6rem; flex-direction: column; justify-content: center; gap: .15rem; padding: .35rem .2rem; border-radius: 1.15rem; font-size: .7rem; line-height: 1.1; text-align: center; white-space: normal; }
  .member-nav .nav-icon { width: 1.35rem; height: 1.35rem; }
}

@media (max-width: 680px) {
  .primary-nav { gap: .1rem; justify-content: space-between; }
  .primary-nav:not(.member-nav) a { padding-inline: .6rem; font-size: .82rem; }
  .environment-banner { display: grid; gap: 0; font-size: .78rem; }
  .site-header { padding: .6rem .85rem; }
  .wordmark-copy small { display: none; }
  .wordmark-copy strong { font-size: .95rem; }
  .member-tools { gap: .35rem; }
  .text-button { padding-inline: .5rem; font-size: .84rem; }
  .page-shell { width: min(100% - 1.25rem, 1280px); padding-top: 1.25rem; }
  .page-heading { grid-template-columns: 1fr; gap: 1rem; }
  .page-heading h1 { font-size: 2rem; }
  .feed-tabs { width: 100%; }
  .feed-tabs a { flex: 1 1 0; justify-content: center; padding-inline: .6rem; }
  .feed-tabs small { display: none; }
  .filter-panel, .filter-panel-high { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; padding: .8rem; border-radius: var(--radius); }
  .filter-panel .filter-category { grid-column: 1 / -1; }
  .filter-actions { display: grid; grid-template-columns: 1fr; }
  .filter-submit, .clear-link { width: 100%; }
  .result-summary { display: grid; }
  .feed-update-tools { align-items: stretch; }
  .feed-update-tools .button { width: 100%; }
  .result-summary p:last-child { display: none; }
  .listing-grid { grid-template-columns: 1fr; }
  .card-footer { align-items: center; }
  .detail-grid { gap: .9rem; }
  .gallery-stage { height: auto; aspect-ratio: 4 / 3; }
  .gallery-step { width: 2.9rem; height: 2.9rem; }
  .image-fallback { min-height: 16rem; }
  .detail-card { border-radius: var(--radius-lg); }
  .detail-actions { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: .15rem; }
  .claims-list { grid-template-columns: 1fr; }
  .claim-row { grid-template-columns: 1fr; padding: .7rem; }
  .claim-thumbnail { width: 5.5rem; }
  .claim-row-actions { flex-direction: row; justify-content: space-between; align-items: center; }
  .auth-shell { grid-template-columns: 1fr; padding: 1.75rem 0; }
  .auth-copy h1 { font-size: 2.4rem; }
  .quiet-list { display: none; }
  .account-heading { grid-template-columns: 1fr; }
  .account-heading .button { width: 100%; justify-self: stretch; }
  .account-summary { display: grid; }
  .account-summary span { text-align: left; }
  .session-card { grid-template-columns: 1fr; padding: 1rem; }
  .session-icon { display: none; }
  .session-card form { grid-column: auto; }
  .session-action-form { width: 100%; }
  .session-card form .button { width: 100%; }
  .session-facts { display: grid; }
  .security-grid { grid-template-columns: 1fr; }
  .security-card { min-height: 0; }
  .auth-card { padding: 1.2rem; border-radius: var(--radius-lg); }
  .auth-card h1, .auth-card h2 { font-size: 1.5rem; }
  .auth-actions { display: grid; }
  .auth-actions .button, .auth-card-wide > .button { width: 100%; }
  .backup-code-list { grid-template-columns: 1fr; }
  .setup-key { font-size: .78rem; letter-spacing: .04em; }
  .device-list li { display: grid; }
  .passkey-actions { grid-template-columns: 1fr; }
  .passkey-actions .button, .passkey-actions [data-passkey-status] { grid-column: auto; width: 100%; }
  .operator-heading { display: grid; align-items: stretch; }
  .operator-heading .button { width: 100%; }
  .operator-grid { grid-template-columns: 1fr; }
  .operator-card { padding: 1rem; }
  .operator-audit-list li { display: grid; gap: .25rem; }
  .operator-review div, .operator-health div { grid-template-columns: 1fr; gap: .2rem; }
  .operator-form .button { width: 100%; }
  .site-footer { display: grid; gap: .55rem; }
  .message-stack { top: auto; bottom: calc(1rem + var(--bottom-bar-space)); right: .6rem; width: calc(100% - 1.2rem); }
}

@media (max-width: 360px) {
  .wordmark-copy { display: none; }
  .filter-panel, .filter-panel-high { grid-template-columns: 1fr; }
  .member-nav a { font-size: .64rem; }
  .price { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .listing-card { opacity: 1; transform: none; }
}

/* Keep keyboard-focused controls from hiding under the floating bottom bar (Safari 15.4+ :has; harmless elsewhere). */
@media (max-width: 760px) {
  html:has(body.has-member-nav) { scroll-padding-bottom: 6.5rem; }
}

/* Older Safari (<15) without aspect-ratio: give photo boxes explicit heights. */
@supports not (aspect-ratio: 1 / 1) {
  .card-thumbnail { height: 13rem; }
  .claim-thumbnail { height: 4.2rem; }
  @media (max-width: 680px) { .gallery-stage { height: 17rem; } }
}

@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--surface-strong); --glass-strong: var(--surface-strong); }
  .site-header, .member-nav, .filter-panel, .auth-card, .allowance-card, .empty-state, .error-state { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* On narrow screens show price/contact/claim information before a long description. */
@media (max-width: 980px) {
  .detail-grid > .detail-media { display: contents; }
  .detail-grid .image-panel { order: 0; }
  .detail-grid > .detail-card { order: 1; }
  .detail-grid .detail-description { order: 2; }
}
