/* PT Scanner — one stylesheet, light and dark. */
:root {
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #f0f0ec; --surface-3: #e7e7e2;
  --text: #17181a; --muted: #686b70; --faint: #9a9ca0; --line: #e4e4df; --line-strong: #d3d3cc;
  --accent: #0f766e; --accent-hover: #0b5f58; --accent-text: #ffffff; --accent-soft: #e3f2ef;
  --good: #15803d; --good-soft: #e3f4e8; --warn: #b45309; --warn-soft: #fdf0dc; --bad: #c0362c; --bad-soft: #fbe6e3;
  --rent: #1d4ed8; --rent-soft: #e5ecfc; --star: #e8a20c; --new: #7c3aed; --new-soft: #efe8fd;
  --shadow-sm: 0 1px 2px rgb(16 18 20 / .06);
  --shadow: 0 1px 2px rgb(16 18 20 / .05), 0 4px 14px rgb(16 18 20 / .06);
  --shadow-lg: 0 10px 40px rgb(16 18 20 / .18);
  --radius: 14px; --radius-sm: 9px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --topbar: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012; --surface: #16191c; --surface-2: #1d2124; --surface-3: #262b2f;
    --text: #ececea; --muted: #9da2a7; --faint: #6d7378; --line: #262a2e; --line-strong: #353a3f;
    --accent: #2cc0b0; --accent-hover: #4fd4c5; --accent-text: #04201d; --accent-soft: #10302c;
    --good: #4ade80; --good-soft: #12301d; --warn: #f0b354; --warn-soft: #33260f; --bad: #f47c70; --bad-soft: #3a1b18;
    --rent: #7aa2ff; --rent-soft: #172345; --star: #f5b83d; --new: #b794ff; --new-soft: #2a1f47;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 6px 18px rgb(0 0 0 / .3);
    --shadow-lg: 0 14px 50px rgb(0 0 0 / .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1012; --surface: #16191c; --surface-2: #1d2124; --surface-3: #262b2f;
  --text: #ececea; --muted: #9da2a7; --faint: #6d7378; --line: #262a2e; --line-strong: #353a3f;
  --accent: #2cc0b0; --accent-hover: #4fd4c5; --accent-text: #04201d; --accent-soft: #10302c;
  --good: #4ade80; --good-soft: #12301d; --warn: #f0b354; --warn-soft: #33260f; --bad: #f47c70; --bad-soft: #3a1b18;
  --rent: #7aa2ff; --rent-soft: #172345; --star: #f5b83d; --new: #b794ff; --new-soft: #2a1f47;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 6px 18px rgb(0 0 0 / .3);
  --shadow-lg: 0 14px 50px rgb(0 0 0 / .55);
  color-scheme: dark;
}

@view-transition { navigation: auto; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
body.locked { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .4rem; font-weight: 700; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; margin: 0 0 .6rem; font-weight: 650; }
h1 small, h2 small { font-weight: 450; color: var(--muted); font-size: .75em; }
main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 64px; }
main.wide { max-width: none; padding: 0; }
.sub, small { color: var(--muted); font-size: .87em; }
.mono, pre, code, kbd { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; font-size: .85em; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface);
  color: var(--muted); font-size: .75em; }
.nowrap { white-space: nowrap; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex: none; vertical-align: -3px; }
.ic.xs { width: 13px; height: 13px; vertical-align: -1px; }
svg use { pointer-events: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── top bar ───────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #155e75);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.logo svg { width: 18px; height: 18px; fill: #fff; stroke: none; }
.gsearch { position: relative; flex: 0 1 380px; display: flex; align-items: center; }
.gsearch .ic { position: absolute; left: 11px; color: var(--muted); }
.gsearch input[name] { padding-left: 36px; padding-right: 34px; height: 38px; border-radius: 10px; background: var(--surface-2); border-color: transparent; }
.gsearch input[name]:focus { background: var(--surface); border-color: var(--line-strong); }
.gsearch kbd { position: absolute; right: 10px; }
.page-listings .gsearch { visibility: hidden; }
.mainnav { display: flex; gap: 2px; margin-left: auto; }
.mainnav a { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 550;
  font-size: .93em; position: relative; transition: background .15s, color .15s; }
.mainnav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a.on { color: var(--text); background: var(--surface-2); }
.live-dot { position: absolute; top: 6px; left: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface); animation: pulse 1.4s infinite; }
.topbar-end { display: flex; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; padding: 0; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── form controls ─────────────────────────────────────── */
input, select, textarea, button { font: inherit; color: inherit; }
input:where(:not([type=checkbox]):not([type=radio])), select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 15px; }
textarea { resize: vertical; line-height: 1.5; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
button, .btn, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; white-space: nowrap;
  font-weight: 600; font-size: .93em; line-height: 1.3; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
button:hover, .btn:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
button:active, .btn:active { transform: translateY(1px); }
.btn.ghost, button.ghost, .button.ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover, button.ghost:hover, .button.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn.sm, button.sm { padding: 6px 11px; font-size: .86em; border-radius: 9px; }
button.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
button.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
button.link, .link-btn { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 550; cursor: pointer; font-size: .9em; }
button.link:hover, .link-btn:hover { background: none; color: var(--accent-hover); }
label { display: block; margin-bottom: 10px; font-size: .9em; }
label.check { display: inline-flex; align-items: center; gap: 7px; margin: 0 12px 6px 0; cursor: pointer; }
fieldset { border: none; padding: 0; margin: 0 0 10px; }
legend { font-size: .85em; color: var(--muted); padding: 0; margin-bottom: 6px; font-weight: 600; }
details > summary { cursor: pointer; }
form.inline { display: inline; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.row .grow, .grow { flex: 1; min-width: 160px; }
.row input:not([type=checkbox]) { width: auto; }
.row input.grow { width: 100%; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* chips, switches, segmented */
.chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; font-size: .88em; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 550; transition: all .15s var(--ease); user-select: none; white-space: nowrap; }
.chip:hover span { border-color: var(--faint); }
.chip input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.sel select { border-radius: 999px; padding: 5px 30px 5px 12px; font-size: 1em; font-weight: 550; height: 33px; }
.chip.sel select:has(option:checked:not([value=""])) { background-color: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a, .seg .chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; color: var(--muted);
  font-weight: 600; font-size: .88em; border: 0; background: transparent; }
.seg a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.seg a:hover { color: var(--text); }
.seg a.on, .seg .chip input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 9px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag, .badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74em; font-weight: 650; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); letter-spacing: .01em; white-space: nowrap; line-height: 1.5; }
.tag-new { background: var(--new-soft); color: var(--new); }
.tag-cut { background: var(--good-soft); color: var(--good); }
.tag-screen { background: var(--accent-soft); color: var(--accent); }
.tag-rent { background: var(--rent-soft); color: var(--rent); }
.tag-gone { background: var(--bad-soft); color: var(--bad); }
.tag-status { background: var(--text); color: var(--bg); text-transform: capitalize; }
.tag-note { background: var(--warn-soft); color: var(--warn); }
.count-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); font-size: .8em; font-weight: 650; color: var(--muted); }
.count-pill.big { font-size: .9em; padding: 3px 11px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── generic cards & tables (runs, settings, presets) ──── */
.card, .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
  min-width: 0; box-shadow: var(--shadow-sm); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; margin-bottom: 18px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.cards > .card { margin-bottom: 0; }
.scroll, .table-wrap { overflow-x: auto; }
table.list, table.ltable { width: 100%; border-collapse: collapse; font-size: .9em; }
table.list th, table.ltable th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85em; border-bottom: 1px solid var(--line);
  padding: 8px; white-space: nowrap; }
table.list td, table.ltable td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
table.list tbody tr:hover, table.ltable tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }
tr.warnrow td { background: var(--warn-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.facts span { display: block; font-size: .78em; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .88em; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 5px; vertical-align: 1px; flex: none; }
.dot.ok { background: var(--good); }
.dot.partial, .dot.queued, .dot.cancelling { background: var(--warn); }
.dot.running { background: var(--accent); animation: pulse 1.2s infinite; }
.dot.failed, .dot.interrupted { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.ok { color: var(--good); }
.warn { color: var(--warn); }
.error { color: var(--bad); }
p.ok, p.error { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--good-soft); }
p.error { background: var(--bad-soft); }
pre { white-space: pre-wrap; word-break: break-word; }
pre.log { max-height: 70vh; overflow: auto; background: #0c0e10; color: #cfd6dc; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .78em; line-height: 1.55; }
ul.cols { columns: 3 220px; padding-left: 18px; font-size: .88em; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 650; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
.crumbs { margin: -6px 0 14px; font-size: .9em; }
.crumbs a { color: var(--muted); font-weight: 550; }
.crumbs a:hover { color: var(--text); }

/* ── home ──────────────────────────────────────────────── */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { font-size: 2rem; margin-bottom: 4px; }
.runs-mini { display: flex; gap: 8px; flex-wrap: wrap; }
.run-pill { display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: .88em; box-shadow: var(--shadow-sm); }
.run-pill:hover { color: var(--text); border-color: var(--line-strong); }
.run-pill small { display: block; font-size: .85em; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
.tile { display: flex; flex-direction: column; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.tile:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.tile span { font-size: .85em; color: var(--muted); font-weight: 600; }
.tile b { font-size: 1.9rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.tile small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf { margin-bottom: 34px; }
.shelf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.shelf-head h2 { font-size: 1.25rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.shelf-head h2 a { color: var(--text); }
.shelf-head h2 a:hover { color: var(--accent); }
.shelf-head h2 .ic { color: var(--star); fill: var(--star); }
.shelf-meta { display: flex; align-items: center; gap: 10px; }
.see-all { font-weight: 600; font-size: .92em; white-space: nowrap; }
.empty-line { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.rail-wrap { position: relative; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 14px; margin: 0 -2px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.rail > .lcard { scroll-snap-align: start; }
@media (min-width: 1100px) { .rail { grid-auto-columns: calc((100% - 3 * 14px) / 4); } }
.rail-btn { position: absolute; top: 30%; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); padding: 0; opacity: 0; transition: opacity .2s; }
.rail-btn:hover { background: var(--surface); color: var(--accent); border-color: var(--line-strong); }
.rail-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.rail-btn.prev { left: -14px; } .rail-btn.next { right: -14px; }
.rail-wrap:hover .rail-btn:not([disabled]) { opacity: 1; }
.rail-btn[disabled] { pointer-events: none; }

/* ── listing card ─────────────────────────────────────── */
.lcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s, opacity .3s;
  min-width: 0; }
.lcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.lcard.is-muted { opacity: .55; }
.lcard.is-sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.lcard.leaving { opacity: 0; transform: scale(.96); }
.lcard-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.lcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease), opacity .3s; }
.lcard-media img:not(.loaded) { opacity: 0; }
.lcard:hover .lcard-media img { transform: scale(1.04); }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); font-weight: 650; text-transform: capitalize;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--surface-3) 12px 13px); }
.noimg span { background: var(--surface); padding: 3px 10px; border-radius: 999px; font-size: .85em; }
.lcard-tags { position: absolute; left: 10px; top: 10px; right: 84px; display: flex; flex-wrap: wrap; gap: 4px; }
.lcard-tags .tag { box-shadow: 0 1px 3px rgb(0 0 0 / .15); background: rgb(255 255 255 / .94); }
.lcard-tags .tag-new { background: var(--new); color: #fff; }
.lcard-tags .tag-cut { background: #15803d; color: #fff; }
.lcard-tags .tag-screen { background: #0f766e; color: #fff; }
.lcard-tags .tag-rent { background: #1d4ed8; color: #fff; }
.lcard-tags .tag-gone { background: #c0362c; color: #fff; }
.lcard-tags .tag-muted { color: #333; }
.lcard-count { position: absolute; right: 10px; bottom: 10px; font-size: .72em; font-weight: 650; color: #fff; background: rgb(0 0 0 / .55);
  padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(4px); }
.lcard-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.star-btn, .hide-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 0;
  background: rgb(255 255 255 / .92); color: #44474b; box-shadow: 0 1px 4px rgb(0 0 0 / .18); cursor: pointer; transition: transform .15s var(--ease), color .15s, background .15s; }
.star-btn:hover, .hide-btn:hover { background: #fff; color: #111; border: 0; transform: scale(1.08); }
.star-btn .ic, .hide-btn .ic { width: 18px; height: 18px; }
.star-btn.on { color: var(--star); }
.star-btn.on .ic { fill: var(--star); stroke: var(--star); }
.star-btn.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.3); } }
.hide-btn { opacity: 0; transition: opacity .2s; }
.lcard:hover .hide-btn, .hide-btn:focus-visible, .hide-btn.on { opacity: 1; }
@media (hover: none) { .hide-btn { opacity: 1; } }
.lcard-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 13px; flex: 1; }
.lcard-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lcard-price b { font-size: 1.18rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lcard-price span { color: var(--muted); font-size: .82em; font-variant-numeric: tabular-nums; }
.lcard-title { color: var(--text); font-weight: 550; font-size: .93em; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.lcard-title:hover { color: var(--accent); }
.lcard-loc { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .84em; min-width: 0; }
.lcard-loc .ic { width: 14px; height: 14px; }
.lcard-loc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84em; color: var(--text); margin-top: 2px; }
.lcard-facts span { display: inline-flex; align-items: center; gap: 4px; }
.lcard-facts .ic { width: 15px; height: 15px; color: var(--muted); }
.lcard-facts .type { text-transform: capitalize; color: var(--muted); }
.lcard-facts .good { color: var(--good); font-weight: 600; }
.lcard-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: .78em; color: var(--muted); }
.lcard-foot .portal { font-weight: 650; margin-right: auto; }

/* ── listings browser ─────────────────────────────────── */
.browse { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.filters-pane { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--line); padding: 18px 18px 40px; scrollbar-width: thin; }
.pane-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pane-head h2 { margin: 0; margin-right: auto; font-size: 1rem; }
.pane-close { display: none; }
.filters .fgroup { margin-bottom: 18px; }
.fgroup.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fgroup.two label { margin: 0; }
.flabel { display: block; font-size: .8em; font-weight: 650; color: var(--muted); margin-bottom: 6px; letter-spacing: .01em; }
.flabel.sm { margin-top: 10px; }
.flabel small { font-weight: 450; }
.range { display: flex; align-items: center; gap: 6px; }
.range span { color: var(--faint); }
.parishes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; max-height: 180px; overflow-y: auto; }
.pchip { padding: 3px 9px; border-radius: 999px; font-size: .78em; font-weight: 550; background: var(--surface-2); color: var(--text); border: 1px solid transparent; }
.pchip small { font-size: .9em; }
.pchip:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.pchip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.portal-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; font-size: .9em; padding-top: 6px; }
details.fgroup > summary { list-style: none; display: flex; align-items: center; gap: 6px; }
details.fgroup > summary::after { content: "›"; margin-left: auto; transition: transform .2s; font-size: 1.3em; line-height: 1; }
details.fgroup[open] > summary::after { transform: rotate(90deg); }

.results-pane { min-width: 0; padding: 18px 24px 60px; }
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tb-title h1 { margin: 0; font-size: 1.45rem; }
.tb-search { position: relative; flex: 1 1 280px; display: flex; align-items: center; max-width: 560px; }
.tb-search .ic { position: absolute; left: 12px; color: var(--muted); }
.tb-search input[name] { padding-left: 38px; height: 40px; border-radius: 11px; }
.tb-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tb-tools .sort { width: auto; height: 38px; }
.filters-toggle { display: none; }
.quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.quick .seg { padding: 2px; }
.quick .seg .chip span { padding: 5px 11px; border: 0; }
.qsep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.results { transition: opacity .2s; }
.results.loading { opacity: .45; pointer-events: none; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rh-count { font-size: .95em; }
.rh-count b { font-size: 1.15em; font-variant-numeric: tabular-nums; }
.rh-desc { color: var(--muted); margin-left: 6px; font-size: .92em; }
.rh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.more { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 28px 0 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h2 { color: var(--text); }
.empty-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.empty-art .ic { width: 28px; height: 28px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; gap: 8px; animation: rise .18s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }

/* list view */
.ltable td.c-thumb { width: 92px; padding-right: 0; }
.ltable .thumb { width: 84px; height: 60px; object-fit: cover; border-radius: 8px; display: block; background: var(--surface-2); }
.ltable div.thumb { font-size: .7em; }
.ltable td.c-title { min-width: 260px; }
.ltable td.c-title > a { color: var(--text); font-weight: 600; }
.ltable td.c-title > a:hover { color: var(--accent); }
.ltable .tags { margin-top: 4px; }
.ltable td.c-act { white-space: nowrap; text-align: right; }
.ltable .star-btn, .ltable .hide-btn { display: inline-grid; width: 30px; height: 30px; box-shadow: none; background: transparent; opacity: 1; color: var(--muted); }
.ltable .star-btn:hover, .ltable .hide-btn:hover { background: var(--surface-3); }
.ltable .star-btn.on { color: var(--star); }
.ltable tr.is-muted { opacity: .5; }
.ltable tr.is-sel td { background: var(--accent-soft); }
.muted-link { color: var(--muted); }

/* map view */
.mapwrap { position: relative; }
.map { height: calc(100vh - var(--topbar) - 190px); min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 1; }
.map-note { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; background: var(--surface); color: var(--text);
  padding: 6px 14px; border-radius: 999px; font-size: .84em; box-shadow: var(--shadow); white-space: nowrap; }
.minimap { height: 240px; border-radius: var(--radius-sm); overflow: hidden; z-index: 1; position: relative; }
.price-pin { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 7px; font-size: 11px;
  font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgb(0 0 0 / .25); transform: translate(-50%, -50%); width: max-content; }
.price-pin.rent { color: var(--rent); }
.price-pin.starred { background: var(--star); color: #111; border-color: var(--star); }
.leaflet-container { font: inherit; background: var(--surface-2); }
:root[data-theme="dark"] .osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9) saturate(.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9) saturate(.6); } }
.leaflet-popup-content-wrapper { border-radius: 12px; padding: 0; overflow: hidden; background: var(--surface); color: var(--text); }
.leaflet-popup-content { margin: 0; width: 250px !important; }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-control-attribution { font-size: 10px; }
.mapcard { display: block; color: var(--text); }
.mapcard:hover { color: var(--text); }
.mapcard img, .mapcard .noimg { width: 100%; height: 140px; object-fit: cover; display: block; }
.mapcard-body { padding: 10px 12px 12px; display: grid; gap: 2px; font-size: 13px; }
.mapcard-body b { font-size: 15px; }
.mapcard-body .t { font-weight: 550; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── listing detail (page + drawer) ───────────────────── */
.page-listing main { max-width: 1060px; }
.gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: #0c0d0e; margin-bottom: 20px; }
.gal-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 16 / 9; max-height: 560px; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; cursor: zoom-in; }
.gallery.none { aspect-ratio: 16 / 6; background: var(--surface-2); }
.gal-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; padding: 0; border: 0;
  background: rgb(255 255 255 / .9); color: #111; box-shadow: var(--shadow); opacity: .85; }
.gal-btn:hover { background: #fff; color: #111; opacity: 1; }
.gal-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.gal-btn.prev { left: 12px; } .gal-btn.next { right: 12px; }
.gal-count { position: absolute; right: 12px; bottom: 12px; background: rgb(0 0 0 / .6); color: #fff; font-size: .78em; font-weight: 650;
  padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ld-head h1 { font-size: 1.55rem; margin: 6px 0 4px; }
.ld-loc { color: var(--muted); margin: 0 0 14px; display: flex; gap: 5px; align-items: center; }
.ld-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ld-price b { font-size: 2rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ld-price span { color: var(--muted); font-variant-numeric: tabular-nums; }
.ld-price .was { text-decoration: line-through; }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px; background: var(--surface); }
.keyfacts > div { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.keyfacts span { display: block; font-size: .75em; color: var(--muted); font-weight: 600; }
.keyfacts b.cap { text-transform: capitalize; }
.ld-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.ld-actions .star-btn, .ld-actions .hide-btn { opacity: 1; width: 38px; height: 38px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: none; color: var(--muted); }
.ld-actions .star-btn.on { color: var(--star); }
.box h2 { display: flex; align-items: center; gap: 8px; }
.saved { margin-left: auto; font-size: .75em; font-weight: 500; color: var(--muted); transition: color .3s; }
.saved.flash { color: var(--good); }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.status-chips .chip span { text-transform: capitalize; padding: 5px 11px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.metrics span { display: block; font-size: .78em; color: var(--muted); font-weight: 600; }
.metrics b { font-size: 1.25rem; letter-spacing: -.02em; }
.metrics small { display: block; }
.desc { white-space: pre-line; line-height: 1.65; }
.desc.clamp { max-height: 15em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 7px 0 7px 16px; border-left: 2px solid var(--line); position: relative; font-size: .9em; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.dlist { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; font-size: .92em; }
.dlist dt { color: var(--muted); }
.dlist dd { margin: 0; word-break: break-word; }
.chart { width: 100%; height: auto; max-height: 220px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .grid { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.chart .mark { fill: var(--accent); }
.chart .axis { fill: var(--muted); font-size: 11px; }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgb(8 10 12 / .38); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--bg); box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform .32s var(--ease); overflow-y: auto; overscroll-behavior: contain; outline: none; }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-body { padding: 0 22px 40px; }
.drawer-body.loading { opacity: .5; }
.panel-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 0; margin-bottom: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.panel-hint { font-size: .8em; color: var(--faint); }
.ld-panel .gallery { border-radius: var(--radius); }
.ld-panel .gal-track { aspect-ratio: 3 / 2; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .94); display: grid; place-items: center; animation: fade .2s; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.lightbox .icon-btn { position: absolute; color: #fff; width: 48px; height: 48px; background: rgb(255 255 255 / .08); border-radius: 50%; }
.lightbox .icon-btn:hover { background: rgb(255 255 255 / .2); color: #fff; }
.lb-close { top: 16px; right: 16px; } .lb-prev { left: 16px; top: 50%; } .lb-next { right: 16px; top: 50%; }
.lb-count { position: absolute; bottom: 18px; color: #ccc; font-size: .85em; }
@keyframes fade { from { opacity: 0; } }

/* toasts, keyboard help */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 12px; font-size: .9em; font-weight: 550; box-shadow: var(--shadow-lg);
  animation: toast-in .3s var(--ease); pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: var(--accent-soft); padding: 0; font-size: 1em; }
.toast button:hover { background: none; color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.keys-help { position: fixed; inset: 0; z-index: 75; background: rgb(8 10 12 / .4); display: grid; place-items: center; }
.keys-help[hidden] { display: none; }
.keys-help .card { width: min(380px, 92vw); box-shadow: var(--shadow-lg); }
.keys-help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; align-items: center; }
.keys-help dd { margin: 0; color: var(--muted); }

/* other pages */
.login { max-width: 380px; margin: 12vh auto; padding: 28px; }
.login h1 { display: flex; align-items: center; gap: 10px; }
.login button { width: 100%; margin-top: 6px; padding: 10px; }
.settings label { margin-bottom: 12px; }
.settings small { display: block; }
.settings label.check small { display: inline; }
.narrow { max-width: 420px; }
.checks { display: flex; flex-wrap: wrap; }
.preset-edit .row:first-child input[name=name] { font-weight: 650; }

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .mainnav a span { display: none; }
  .mainnav a { padding: 8px 10px; }
  .live-dot { left: 24px; top: 5px; }
}
@media (max-width: 900px) {
  .browse { grid-template-columns: minmax(0, 1fr); }
  .filters-pane { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: auto; width: min(360px, 88vw); transform: translateX(-102%);
    transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); border-right: 0; }
  .pane-open .filters-pane { transform: none; }
  .pane-scrim { position: fixed; inset: 0; z-index: 55; background: rgb(8 10 12 / .38); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .pane-open .pane-scrim { opacity: 1; pointer-events: auto; }
  .pane-close, .filters-toggle { display: inline-grid; }
  .filters-toggle { display: inline-flex; }
  .results-pane { padding: 14px 16px 60px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gsearch { display: none; }
  .brand-name { display: none; }
  .tb-title { flex-basis: 100%; }
  .tb-search { flex-basis: 100%; max-width: none; order: 2; }
  .tb-tools { margin-left: 0; flex-wrap: wrap; order: 3; width: 100%; }
  .tb-tools .sort { flex: 1; }
  .seg a span { display: none; }
  .quick { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 12px; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .quick > * { flex: none; }
  .map { height: calc(100vh - 300px); }
}
@media (min-width: 901px) { .pane-scrim { display: none; } }
@media (max-width: 600px) {
  main { padding: 16px 16px 48px; }
  .topbar { padding: 0 10px 0 16px; gap: 6px; }
  .mainnav { gap: 0; }
  .mainnav a { padding: 8px; }
  .topbar-end #theme-btn { display: none; }
  .hero h1 { font-size: 1.55rem; }
  .tile { padding: 12px 14px; }
  .tile b { font-size: 1.5rem; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rail { grid-auto-columns: 78%; }
  .drawer-body { padding: 0 14px 32px; }
  .ld-price b { font-size: 1.6rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .dlist { grid-template-columns: 110px 1fr; }
  .menu-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* sign-in, consent, tokens */
.google-btn { width: 100%; padding: 10px; gap: 10px; margin: 6px 0 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85em; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login .row button { width: auto; flex: 1; }
.token-box { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 14px; }
.token-box pre { background: var(--surface); padding: 8px 10px; border-radius: 8px; user-select: all; }
.card code { word-break: break-all; }

/* comparisons and deals */
.vs-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.vs { display: inline-flex; font-size: .74em; font-weight: 650; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--muted); }
.vs.down { background: var(--good-soft); color: var(--good); }
.vs.up { background: var(--bad-soft); color: var(--bad); }
.vs.sus { background: var(--warn-soft); color: var(--warn); text-decoration: underline dotted; }
td .vs { font-size: .85em; }
.tag-hot { background: #ea580c; color: #fff; }
.lcard-tags .tag-hot { background: #ea580c; color: #fff; }
.hot-title .ic, h1 .ic { color: #ea580c; fill: #ea580c; stroke: #ea580c; }
.box.compare h2 { flex-wrap: wrap; }
.cmp-row { display: grid; grid-template-columns: minmax(120px, 280px) 1fr auto 56px; gap: 10px; align-items: center; padding: 5px 0;
  font-size: .9em; }
.cmp-label { line-height: 1.3; }
.cmp-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cmp-bar i { display: block; height: 100%; background: var(--faint); border-radius: 999px; }
.cmp-row.me .cmp-bar i { background: var(--accent); }
.cmp-row.me { font-weight: 650; }
.cmp-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-pct { text-align: right; }
.deal-scope { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 24px; }
.chip-link { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-size: .88em; font-weight: 550; }
.chip-link:hover { color: var(--text); border-color: var(--faint); }
.chip-link.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-link.toggle { margin-left: auto; }
.card.how { margin-top: 10px; }
@media (max-width: 600px) {
  .cmp-row { grid-template-columns: 1fr auto 50px; }
  .cmp-bar { grid-column: 1 / -1; grid-row: 2; }
  .chip-link.toggle { margin-left: 0; }
}
