/* Flat finder: one stylesheet, light and dark from the system. Tokens first, then components.
   Color carries meaning only: green = confirmed, ochre = still to ask, yellow = new. Photos bring the rest. */

:root {
  color-scheme: light dark;
  --bg: oklch(0.972 0.006 85);
  --surface: oklch(0.993 0.003 85);
  --surface-2: oklch(0.945 0.008 85);
  --surface-3: oklch(0.91 0.01 85);
  --line: oklch(0.895 0.009 85);
  --line-2: oklch(0.83 0.012 85);
  --ink: oklch(0.22 0.014 70);
  --ink-2: oklch(0.42 0.013 72);
  --ink-3: oklch(0.51 0.011 75);
  --btn: oklch(0.24 0.016 70);
  --btn-hover: oklch(0.32 0.016 70);
  --btn-ink: oklch(0.985 0.004 85);
  --hi: oklch(0.87 0.155 94);
  --hi-ink: oklch(0.26 0.05 80);
  --ok: oklch(0.52 0.12 150);
  --ok-soft: oklch(0.95 0.035 150);
  --ask: oklch(0.53 0.11 66);
  --ask-soft: oklch(0.955 0.032 82);
  --warn: oklch(0.53 0.15 42);
  --warn-soft: oklch(0.955 0.03 55);
  --bad: oklch(0.52 0.17 27);
  --photo-bg: oklch(0.92 0.01 85);
  --scrim: oklch(0.2 0.01 70 / 0.62);
  --shadow: 0 1px 2px oklch(0.3 0.03 70 / 0.07), 0 8px 24px -12px oklch(0.3 0.03 70 / 0.18);
  --shadow-up: 0 -1px 0 var(--line), 0 -8px 24px -16px oklch(0.3 0.03 70 / 0.25);
  --focus: oklch(0.24 0.016 70);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-md: 1rem; --fs-lg: 1.1875rem; --fs-xl: 1.5rem; --fs-2xl: 1.875rem;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --gutter: 16px;
  --tabbar: 58px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.165 0.008 70);
    --surface: oklch(0.205 0.009 70);
    --surface-2: oklch(0.245 0.01 70);
    --surface-3: oklch(0.29 0.011 70);
    --line: oklch(0.28 0.01 70);
    --line-2: oklch(0.36 0.012 70);
    --ink: oklch(0.945 0.008 85);
    --ink-2: oklch(0.79 0.01 80);
    --ink-3: oklch(0.67 0.01 80);
    --btn: oklch(0.93 0.01 85);
    --btn-hover: oklch(0.86 0.01 85);
    --btn-ink: oklch(0.19 0.01 70);
    --hi: oklch(0.86 0.15 94);
    --hi-ink: oklch(0.24 0.05 80);
    --ok: oklch(0.76 0.13 152);
    --ok-soft: oklch(0.27 0.04 152);
    --ask: oklch(0.81 0.12 80);
    --ask-soft: oklch(0.28 0.04 75);
    --warn: oklch(0.76 0.13 50);
    --warn-soft: oklch(0.28 0.045 45);
    --bad: oklch(0.72 0.15 27);
    --photo-bg: oklch(0.25 0.01 70);
    --scrim: oklch(0.12 0.01 70 / 0.7);
    --shadow: 0 0 0 1px var(--line);
    --shadow-up: 0 -1px 0 var(--line);
    --focus: oklch(0.93 0.01 85);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-md)/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ── app frame ─────────────────────────────────────── */
#app { min-height: 100dvh; }
.page { max-width: 1180px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) var(--gutter) calc(var(--tabbar) + var(--safe-b) + 40px); }
.page.narrow { max-width: 720px; }
.page.search { max-width: 720px; }
@media (min-width: 900px) { .page.search { max-width: 1180px; } .sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } .sgrid .out { text-align: left; } .sgrid > div > .sec:first-child { margin-top: 8px; } }

.topbar { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 500; letter-spacing: 0.01em;
  position: relative;
}
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a svg.i { width: 23px; height: 23px; }
.tabbar .dot { position: absolute; top: 7px; left: calc(50% + 7px); min-width: 8px; height: 8px; border-radius: 4px; background: var(--hi); box-shadow: 0 0 0 2px var(--bg); }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 28px; position: sticky; top: 0; z-index: 40;
    height: 60px; padding: 0 max(24px, calc((100vw - 1180px) / 2 + 16px));
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; margin-right: auto; }
  .topbar .brand img { width: 26px; height: 26px; border-radius: 7px; }
  .topbar nav { display: flex; gap: 4px; }
  .topbar nav a { text-decoration: none; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; padding: 8px 12px; border-radius: 999px; position: relative; }
  .topbar nav a:hover { color: var(--ink); background: var(--surface-2); }
  .topbar nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
  .topbar .dot { display: inline-block; width: 7px; height: 7px; border-radius: 4px; background: var(--hi); margin-left: 6px; vertical-align: 2px; }
  .page { padding-top: 32px; padding-bottom: 64px; padding-left: 32px; padding-right: 32px; }
}

/* ── headings ──────────────────────────────────────── */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 20px; }
.head h1 { font-size: var(--fs-2xl); font-weight: 720; letter-spacing: -0.025em; line-height: 1.1; }
.head .sub { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-sm); }
.head .sub b { color: var(--ink); font-weight: 600; }
.newlink { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--hi); text-decoration-thickness: 3px; text-underline-offset: 3px; }

/* segmented filter */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.seg a { text-decoration: none; font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.seg a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0.3 0.02 70 / 0.12); }
.seg a span { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
@media (prefers-color-scheme: dark) { .seg a[aria-current="true"] { background: var(--surface-3); box-shadow: none; } }

/* ── notice: the slim alerts line ──────────────────── */
.notice {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px;
  padding: 12px 8px 12px 14px; margin-bottom: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.notice > .i { color: var(--ink-2); }
.notice p { font-size: var(--fs-sm); line-height: 1.35; }
.notice p b { font-weight: 600; }
.notice .acts { display: flex; align-items: center; gap: 2px; }
.notice .x { width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; color: var(--ink-3); border-radius: 999px; }
@media (hover: hover) { .notice .x:hover { background: var(--surface-2); color: var(--ink); } }
.notice ol { grid-column: 1 / -1; margin: 8px 0 4px; padding: 12px 0 0 0; list-style: none; border-top: 1px solid var(--line); display: grid; gap: 10px; counter-reset: step; }
.notice li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; font-size: var(--fs-sm); counter-increment: step; }
.notice li::before { content: counter(step); width: 26px; height: 26px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-xs); }
.notice li .i { display: inline; vertical-align: -4px; width: 18px; height: 18px; margin: 0 2px; }

/* ── buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap;
  background: var(--surface-2); color: var(--ink); border: 1px solid transparent;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--surface-3); } }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
@media (hover: hover) { .btn.primary:hover { background: var(--btn-hover); } }
.btn.big { min-height: 52px; font-size: var(--fs-md); border-radius: 14px; padding: 0 20px; }
.btn.quiet { background: transparent; border-color: var(--line-2); }
@media (hover: hover) { .btn.quiet:hover { background: var(--surface-2); } }
.btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (hover: hover) { .btn.quiet.on:hover { background: var(--ink); } }   /* a pressed button stays dark under the pointer */
.btn.small { min-height: 34px; padding: 0 12px; font-size: var(--fs-xs); border-radius: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; font-size: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
@media (hover: hover) { .link:hover { text-decoration-color: currentColor; } }

/* ── tiers and cards ───────────────────────────────── */
.tier { margin-top: 30px; }
.tier:first-of-type { margin-top: 6px; }
.tier-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.tier-head h2 { font-size: var(--fs-lg); font-weight: 680; letter-spacing: -0.015em; }
.tier-head .n { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 500; }
.tier-head p { color: var(--ink-3); font-size: var(--fs-sm); margin-left: auto; text-align: right; }
.cards { display: grid; gap: 16px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; overflow: hidden;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), opacity 200ms var(--ease);
}
@media (hover: hover) { .card:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 14px 32px -18px oklch(0.3 0.03 70 / 0.35); } }
.card:active { transform: scale(0.99); }
.card .ph { position: relative; aspect-ratio: 16 / 10; background: var(--photo-bg); overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.broken img, .ph.none img { display: none; }
.ph.broken::after, .ph.none::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; opacity: 0.35;
  background: currentColor; color: var(--ink-3);
  -webkit-mask: var(--house) center / contain no-repeat; mask: var(--house) center / contain no-repeat;
}
:root { --house: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M4 10.5 12 4l8 6.5V20H4z'/%3E%3Cpath d='M10 20v-5h4v5'/%3E%3C/svg%3E"); }

.badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.01em; }
.badge.new { background: var(--hi); color: var(--hi-ink); }
.badge.dark { background: var(--scrim); color: oklch(0.98 0.004 85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.badge.plain { background: var(--surface-2); color: var(--ink-2); }
.badge.contacted { background: var(--surface); color: var(--ink); }
.card .badges.bottom { top: auto; bottom: 12px; }
.save {
  position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: oklch(0.99 0.003 85);
}
.save span { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform 160ms var(--ease); }
.save:active span { transform: scale(0.88); }
.save[aria-pressed="true"] svg { fill: var(--hi); stroke: var(--hi); }
.save[aria-pressed="true"] span { background: oklch(0.2 0.01 70 / 0.78); }

.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.price .amt { font-size: 1.375rem; font-weight: 720; letter-spacing: -0.02em; line-height: 1.15; }
.price .rest { color: var(--ink-2); font-size: var(--fs-sm); }
.price .rest .gap { color: var(--ask); font-weight: 550; }
.what { font-size: var(--fs-md); font-weight: 560; }
.what .where { color: var(--ink-2); font-weight: 400; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-sm); }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.facts .i { width: 16px; height: 16px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 550; background: var(--ask-soft); color: var(--ink); }
.chip b { color: var(--ask); font-weight: 650; }
.card .note { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.card .note.warn { color: var(--warn); font-weight: 550; }
.pulse { width: 8px; height: 8px; border-radius: 4px; background: var(--ask); animation: pulse 1.4s var(--ease) infinite; flex: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.card.gone .ph img { filter: grayscale(1); opacity: 0.55; }
.card.gone .body > :not(.note) { opacity: 0.6; }
.card.option .ph img { filter: saturate(0.6); }

.listfoot { margin-top: 36px; text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }

/* empty and loading */
.empty { max-width: 420px; margin: 56px auto 0; text-align: center; }
.empty .glyph { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.empty .glyph .i { width: 26px; height: 26px; }
.empty h2 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
.empty p { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-sm); }
.empty .btn { margin-top: 18px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.sk-card .sk.ph { aspect-ratio: 16 / 10; border-radius: 0; }
.sk-card .lines { padding: 16px; display: grid; gap: 10px; }
.err { margin: 40px auto; max-width: 420px; text-align: center; color: var(--ink-2); }
.err .btn { margin-top: 14px; }

/* ── listing page ──────────────────────────────────── */
.listing { padding-top: 0; }
.lbar {
  position: fixed; z-index: 30; inset: 0 0 auto 0; height: calc(var(--safe-t) + 56px); padding: var(--safe-t) 12px 0;
  display: flex; align-items: center; gap: 12px; border-bottom: 1px solid transparent;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}
.lbar.solid { background: var(--bg); border-bottom-color: var(--line); }
.lbar-t { font-weight: 650; font-size: var(--fs-md); opacity: 0; transition: opacity 200ms var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbar.solid .lbar-t { opacity: 1; }
.back {
  width: 40px; height: 40px; flex: none; border-radius: 20px; display: grid; place-items: center;
  background: var(--scrim); color: oklch(0.99 0.003 85); border: 0; text-decoration: none;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.lbar.solid .back { background: var(--surface-2); color: var(--ink); }
.gallery { position: relative; margin: 0 calc(var(--gutter) * -1); background: var(--photo-bg); }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; max-height: 62vh; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; background: var(--photo-bg); }
.gallery .slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery .count { position: absolute; right: 12px; bottom: 12px; }
.gallery .arrow { display: none; }
.listing .badges { left: 12px; top: auto; bottom: 12px; }

.lhead { padding: 18px 0 4px; }
.lhead .price .amt { font-size: 1.75rem; }
.lhead .what { margin-top: 4px; font-size: var(--fs-lg); }
.lhead .summary { margin-top: 10px; color: var(--ink-2); max-width: 62ch; }
.banner { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.banner .i { margin-top: 1px; }
.banner.warn { background: var(--warn-soft); }
.banner.warn .i { color: var(--warn); }
.banner.fail .i { color: var(--bad); }
.banner .q { grid-column: 2; color: var(--ink-2); font-style: italic; }
.banner .acts { grid-column: 2; margin-top: 6px; display: flex; gap: 8px; }

.states { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; margin-top: 18px; }
.states .btn { padding: 0 8px; font-size: 13px; gap: 6px; }
.states .btn.on svg { fill: currentColor; }
.states .btn.on.c svg { fill: none; }

.sec { margin-top: 30px; }
.sec > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: var(--fs-lg); font-weight: 680; letter-spacing: -0.015em; margin-bottom: 10px; }
.sec > h2 small { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.checks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 2px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.checks .mark { width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; margin-top: 1px; }
.checks .mark .i { width: 14px; height: 14px; stroke-width: 2.6; }
.checks .pass .mark { background: var(--ok-soft); color: var(--ok); }
.checks .ask .mark { background: var(--ask-soft); color: var(--ask); }
.checks .fail .mark { background: color-mix(in oklch, var(--bad) 16%, var(--surface)); color: var(--bad); }
.checks .pending .mark { background: var(--surface-2); color: var(--ink-3); }
.checks .lbl { font-weight: 560; }
.checks .q { grid-column: 2; font-size: var(--fs-sm); color: var(--ink-2); }
.checks .q.quote { font-style: italic; }
.checks .ask .q { color: var(--ask); font-style: normal; font-weight: 550; }
.checks .ask.warnish .q { color: var(--warn); }
.checks .fail .q { color: var(--bad); font-style: normal; font-weight: 550; }
.checks .fail .q.quote { color: var(--ink-2); font-style: italic; font-weight: 400; }

.dl { display: grid; grid-template-columns: max-content 1fr; margin: 0; border-top: 1px solid var(--line); }
.dl dt, .dl dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--ink-3); font-size: var(--fs-sm); padding-right: 18px; padding-top: 12px; }
.dl dd { font-size: var(--fs-md); }
.dl dd.muted { color: var(--ink-3); }

.asks { display: grid; gap: 8px; }
.askline {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; width: 100%;
  padding: 13px 12px 13px 14px; text-align: left; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-md); line-height: 1.4;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
@media (hover: hover) { .askline:hover { border-color: var(--line-2); } }
.askline .cp { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.askline.done { border-color: var(--ok); background: var(--ok-soft); }
.askline.done .cp { color: var(--ok); }
.copyall { font-size: var(--fs-sm); }

.desc { color: var(--ink-2); white-space: pre-line; max-width: 68ch; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.alsoon { margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.alsoon a { color: var(--ink); font-weight: 550; }
.paidnote { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); }

.actionbar {
  position: fixed; inset: auto 0 0 0; z-index: 35;
  padding: 10px var(--gutter) calc(10px + var(--safe-b));
  background: var(--bg);
  box-shadow: var(--shadow-up);
}
.actionbar .btn { width: 100%; }
.actionbar small { display: block; text-align: center; margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.didyou { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); font-size: var(--fs-sm); font-weight: 550; animation: rise 240ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.listing.page { padding-bottom: calc(96px + var(--safe-b)); }

@media (min-width: 900px) {
  .lbar { display: none; }
  .crumb { display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 18px -6px; padding: 6px; color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 550; border-radius: 8px; }
  .crumb:hover { color: var(--ink); background: var(--surface-2); }
  .lgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 44px; align-items: start; }
  .lgrid .left { position: sticky; top: 84px; }
  .gallery { margin: 0; border-radius: var(--r-lg); overflow: hidden; }
  .gallery .track { max-height: calc(100vh - 140px); }
  .gallery .arrow { display: grid; place-items: center; position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); opacity: 0; transition: opacity 160ms var(--ease); }
  .gallery:hover .arrow { opacity: 1; }
  .gallery .arrow.prev { left: 14px; } .gallery .arrow.next { right: 14px; }
  .gallery .arrow[disabled] { opacity: 0 !important; }
  .lhead { padding-top: 0; }
  .actionbar { position: static; padding: 0; margin-top: 20px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  .actionbar small { text-align: left; }
  .listing.page { padding-bottom: 64px; }
  .states { margin-top: 10px; }
}
@media (max-width: 899px) { .crumb { display: none; } }

/* ── not shown ─────────────────────────────────────── */
.filters { display: flex; gap: 8px; margin: 0 calc(var(--gutter) * -1) 18px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .fchip { flex: none; }
@media (min-width: 900px) {
  .filters { flex-wrap: wrap; margin: 0 0 22px; padding: 0; overflow: visible; }
  /* Desktop: the reasons become a list on the left, so any number of them fits. */
  .nsgrid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
  .nsgrid .filters { flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; position: sticky; top: 92px; }
  .nsgrid .fchip { justify-content: space-between; min-height: 38px; padding: 0 12px; border-color: transparent; border-radius: 10px; }
  .nsgrid .fchip:hover { background: var(--surface-2); }
  .nsgrid .fchip[aria-current="true"] { background: var(--ink); border-color: var(--ink); }
}
.fchip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: var(--fs-sm); font-weight: 550; color: var(--ink); text-decoration: none; }
.fchip span { color: var(--ink-3); font-weight: 500; }
.fchip[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fchip[aria-current="true"] span { color: color-mix(in oklch, var(--bg) 70%, transparent); }
.rows { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
.row { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row .ph { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--photo-bg); }
.row .ph img { width: 100%; height: 100%; object-fit: cover; }
.row .ph.broken::after, .row .ph.none::after { width: 26px; height: 26px; }
.row .main { min-width: 0; }
.row .t { display: flex; flex-wrap: wrap; column-gap: 8px; font-weight: 560; text-decoration: none; color: inherit; }
.row .t .p { color: var(--ink-2); font-weight: 400; font-size: var(--fs-sm); align-self: baseline; }
.row .act { margin-top: 6px; font-size: var(--fs-sm); }
.row .why { font-size: var(--fs-sm); font-weight: 600; margin-top: 2px; }
.row .q { font-size: var(--fs-sm); color: var(--ink-2); font-style: italic; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── my search ─────────────────────────────────────── */
.musts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.musts li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; min-height: 52px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.musts li > .i { color: var(--ink-3); width: 18px; height: 18px; stroke-width: 2.2; }
.musts .val { font-weight: 600; }
.edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; grid-column: 2 / -1; }
.field { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); }
.field:focus-within { border-color: var(--ink); }
.field input { border: 0; outline: 0; background: none; width: 7ch; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.field input[type="date"] { width: auto; }
.hint { grid-column: 2 / -1; font-size: var(--fs-sm); color: var(--ink-3); }
.hint.bad { color: var(--bad); }
.wishes { margin: 0; padding: 0; list-style: none; counter-reset: w; border-top: 1px solid var(--line); }
.wishes li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); counter-increment: w; }
.wishes li::before { content: counter(w); color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.wishes li small { display: block; color: var(--ink-3); font-size: var(--fs-sm); }
.alertbox { padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.alertbox .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.alertbox h3 { font-size: var(--fs-md); font-weight: 600; }
.alertbox p { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.alertbox ol { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: step; }
.alertbox li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; font-size: var(--fs-sm); counter-increment: step; }
.alertbox li::before { content: counter(step); width: 26px; height: 26px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-xs); }
.alertbox li .i { display: inline; vertical-align: -4px; width: 18px; height: 18px; margin: 0 2px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; border-radius: 16px; border: 0; padding: 0; background: var(--surface-3); transition: background-color 200ms var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: oklch(0.99 0.003 85); box-shadow: 0 2px 4px oklch(0.2 0.02 70 / 0.25); transition: transform 220ms var(--ease); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.out { margin-top: 36px; text-align: center; }

/* ── health ────────────────────────────────────────── */
.srcs { border-top: 1px solid var(--line); }
.src { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.src .n { font-weight: 600; }
.src .m { grid-column: 1; font-size: var(--fs-sm); color: var(--ink-2); }
.src .s { grid-row: 1 / span 2; grid-column: 2; align-self: center; display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 600; }
.src .s::before { content: ""; width: 9px; height: 9px; border-radius: 5px; background: var(--ink-3); }
.src .s.ok::before { background: var(--ok); }
.src .s.quiet::before { background: var(--ink-3); }
.src .s.failing { color: var(--bad); }
.src .s.failing::before { background: var(--bad); }
.src .s.off { color: var(--ink-3); }
.src .s.off::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.stats div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.stats dt { font-size: var(--fs-sm); color: var(--ink-3); }
.stats dd { margin: 2px 0 0; font-weight: 600; }
@media (min-width: 900px) { .hgrid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; } .hgrid .sec:first-child { margin-top: 0; } }

/* ── login ─────────────────────────────────────────── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter) calc(24px + var(--safe-b)); }
.login form { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.login .mark { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 8px; box-shadow: var(--shadow); }
.login h1 { text-align: center; font-size: var(--fs-xl); font-weight: 720; letter-spacing: -0.02em; }
.login p { text-align: center; color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: 12px; }
.login input { height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-size: var(--fs-md); outline: 0; }
.login input:focus { border-color: var(--ink); }
.login .msg { text-align: center; color: var(--bad); font-size: var(--fs-sm); min-height: 1.4em; }

/* ── toast and update ──────────────────────────────── */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 14px);
  translate: -50% 0; display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100vw - 2 * var(--gutter)); padding: 10px 10px 10px 16px; border-radius: 14px;   /* max-content: with left 50% it would wrap at half the screen */
  background: var(--btn); color: var(--btn-ink); font-size: var(--fs-sm); font-weight: 550;
  box-shadow: 0 12px 32px -12px oklch(0.15 0.02 70 / 0.5);
  animation: rise 220ms var(--ease);
}
.toast.solo { padding-right: 16px; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; padding: 8px 10px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
body.has-actionbar .toast { bottom: calc(86px + var(--safe-b)); }
@media (min-width: 900px) { .toast, body.has-actionbar .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* card link covers the card; the save button sits above it */
.card .cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card .cover:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.card .save { z-index: 2; }
.card .badges { z-index: 2; pointer-events: none; }
.tier-note { margin: -8px 0 12px; color: var(--ink-3); font-size: var(--fs-sm); }
.slide.broken::after, .slide.none::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; opacity: 0.35;
  background: currentColor; color: var(--ink-3);
  -webkit-mask: var(--house) center / contain no-repeat; mask: var(--house) center / contain no-repeat;
}
.slide.broken img { display: none; }

/* Not shown: the same card as Matches, with the reason where the questions go */
.nslist { min-width: 0; }
.nslist .tier:first-child { margin-top: 0; }
.card.ns .why { display: flex; align-items: flex-start; gap: 7px; margin-top: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--bad); }
.card.ns .why .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.card.ns .q { font-size: var(--fs-sm); color: var(--ink-2); font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.ns .acts { position: relative; z-index: 2; margin-top: 6px; }
@media (min-width: 900px) { .nslist .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nearlink { display: flex; align-items: center; gap: 8px; margin: 26px 0 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 560; }
.nearlink span { flex: 1; }
.nearlink .i { width: 18px; height: 18px; color: var(--ink-3); }
