:root {
  --paper: #f2efe8;
  --ink: #1d211f;
  --muted: #555b56;
  --line: rgba(29, 33, 31, .14);
  --accent: #a84028;
  --green: #2c725c;
  --card: #faf8f3;
  --shadow: 0 28px 70px rgba(34, 30, 25, .13);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
::selection { background: rgba(168, 64, 40, .22); color: var(--ink); }
button, summary, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #3a70aa; outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: var(--ink); color: white; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 26px; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; gap: 16px; }
.review-filter { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; width: fit-content; color: var(--ink); cursor: pointer; font-size: .82rem; font-weight: 650; }
.review-filter input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.progress-copy { display: flex; align-items: center; gap: 12px; font-size: .82rem; color: var(--muted); }
.progress-copy strong { color: var(--ink); font-size: .92rem; }
.selected-trigger { min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px 4px; font: 650 .82rem/1.2 system-ui, sans-serif; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.selected-trigger:disabled { cursor: wait; opacity: .5; }
.selected-count { min-width: 22px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font: 700 .72rem/1 ui-monospace, monospace; text-align: center; }
.topbar-actions { justify-self: end; display: flex; }
.quiet-button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 10px; font: inherit; }
.quiet-button:disabled { cursor: wait; opacity: .5; }
.progress-track { height: 2px; background: var(--line); margin: 8px 0 16px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.loading, .error { display: grid; min-height: 65vh; place-items: center; text-align: center; color: var(--muted); }
.error { color: #7b281d; }
.error h2 { margin: 0 0 8px; color: var(--ink); font: 450 1.55rem/1.1 Georgia, serif; }
.error p { max-width: 48ch; margin: 0 auto 18px; line-height: 1.5; }
.retry-button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--ink); border-radius: 3px; background: var(--ink); color: white; font: 650 .82rem/1 system-ui, sans-serif; cursor: pointer; }
.retry-button:disabled { cursor: wait; opacity: .55; }
.deck { min-height: min(720px, calc(100vh - 180px)); display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(360px, .82fr); background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); touch-action: pan-y; }
.gallery { min-height: 620px; background: #d8d5cf; position: relative; overflow: hidden; }
.gallery img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; color: transparent; background: #d8d5cf; }
.photo-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 2rem; color: #4f544f; text-align: center; line-height: 1.5; }
.gallery-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.32), transparent 18%, transparent 77%, rgba(0,0,0,.38)); pointer-events: none; }
.gallery-head, .gallery-foot { position: absolute; z-index: 2; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; color: white; }
.gallery-head { top: 18px; }
.gallery-foot { bottom: 17px; font-size: .78rem; font-weight: 650; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.pill { padding: 8px 11px; background: rgba(17,20,18,.65); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.16); border-radius: 2px; font: 700 .72rem/1 ui-monospace, monospace; }
.listing-pills { display: flex; align-items: center; gap: 8px; }
.rental-pill { background: rgba(143, 47, 32, .9); }
.decision-pill.keep { background: rgba(24, 94, 70, .82); }
.decision-pill.skip { background: rgba(143, 47, 32, .82); }
.photo-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 44px; height: 60px; border: 1px solid rgba(255,255,255,.28); color: white; background: rgba(10,12,11,.28); cursor: pointer; font-size: 1.1rem; }
.photo-nav.prev { left: 14px; } .photo-nav.next { right: 14px; }
.facts { padding: clamp(24px, 3.3vw, 48px); overflow: auto; max-height: min(720px, calc(100vh - 180px)); }
.headline { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 750 .78rem/1.2 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
h1 { font: 450 clamp(1.65rem, 2.7vw, 2.5rem)/1.02 Georgia, 'Times New Roman', serif; letter-spacing: -.035em; margin: 0; max-width: 15ch; }
.price { text-align: right; white-space: nowrap; }
.price strong { display: block; font: 650 1.45rem/1 ui-monospace, monospace; }
.price span { display: block; margin-top: 5px; color: var(--muted); font-size: .78rem; }
.source-link { min-height: 44px; width: fit-content; margin-top: 14px; display: inline-flex; align-items: center; color: var(--ink); font-size: .82rem; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); margin: 30px 0 24px; border-block: 1px solid var(--line); }
.vitals div { padding: 16px 8px; border-right: 1px solid var(--line); }
.vitals div:last-child { border: 0; }
.vitals strong, .vitals span { display: block; }
.vitals strong { font: 650 1.05rem/1.2 ui-monospace, monospace; }
.vitals span { color: var(--muted); font-size: .78rem; margin-top: 4px; }
details { border-bottom: 1px solid var(--line); }
summary { min-height: 44px; display: flex; align-items: center; padding: 10px 0; cursor: pointer; font-weight: 650; font-size: .82rem; letter-spacing: .03em; }
.description p, .evidence p, .original dd { color: #4f544f; line-height: 1.55; font-size: .88rem; margin: 12px 0 3px; overflow-wrap: anywhere; }
.original dl { margin: 0; }
.original dl > div + div { margin-top: 14px; }
.original dt { margin-top: 12px; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.original dd { margin-inline-start: 0; white-space: pre-wrap; }
.score-card { margin: 23px 0 8px; padding: 20px; background: #eae6dc; }
.score-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 17px; }
.score-heading h2 { margin: 0; font: 450 1.3rem/1 Georgia, serif; }
.score-heading > strong { font: 650 1.3rem/1 ui-monospace, monospace; }
.score-row { display: flex; justify-content: space-between; gap: 10px; font-size: .81rem; margin-top: 13px; }
.score-row span:last-child { font-family: ui-monospace, monospace; }
.score-bar { margin-top: 6px; height: 3px; background: rgba(29,33,31,.12); }
.score-bar span { display: block; width: 100%; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.score-detail { margin: 6px 0 0; color: #4c514d; font-size: .78rem; line-height: 1.4; }
.semantic-details section { padding: 11px 0; border-bottom: 1px solid var(--line); }
.semantic-details section:last-of-type { border-bottom: 0; }
.semantic-details section div { display: flex; justify-content: space-between; gap: 16px; font-size: .81rem; }
.semantic-details section div span { flex: none; font-family: ui-monospace, monospace; color: var(--muted); }
.semantic-details section p, .semantic-risks { margin: 6px 0 0; color: #4c514d; font-size: .78rem; line-height: 1.45; overflow-wrap: anywhere; }
.semantic-details .derived-facts { color: var(--muted); }
.semantic-risks { color: #7b281d; }
.semantic-risks ul { margin: 8px 0 0; padding-inline-start: 20px; }
.semantic-risks li + li { margin-top: 7px; }
.semantic-photo { min-height: 36px; padding: 6px 10px; border: 1px solid rgba(29,33,31,.3); border-radius: 3px; background: var(--card); color: var(--ink); text-decoration: underline; cursor: pointer; font: 650 .78rem/1 system-ui, sans-serif; }
.evidence h3 { margin: 12px 0 0; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.evidence h3 + p { margin-top: 5px; }
.enrichment { margin-top: 14px; padding: 16px; border: 1px solid var(--line); background: #f1ede3; }
.enrichment p { margin: 0 0 12px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.settings-dialog, .selected-dialog { max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 6px; padding: 24px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.settings-dialog { width: min(680px, calc(100% - 24px)); overflow: auto; }
.settings-dialog::backdrop, .selected-dialog::backdrop { background: rgba(20,23,21,.46); backdrop-filter: blur(3px); }
.settings-heading, .settings-buttons { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-heading h2 { margin: 0; font: 450 1.55rem/1 Georgia, serif; }
.settings-heading button { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 1.5rem; }
.settings-dialog label { display: grid; gap: 6px; margin-top: 16px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.settings-dialog input, .settings-dialog select, .settings-dialog textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 3px; padding: 10px; background: white; color: var(--ink); font: 400 1rem/1.3 system-ui, sans-serif; }
.settings-dialog textarea { resize: vertical; }
.settings-dialog small { display: block; margin-top: 6px; color: var(--muted); font-size: .78rem; }
.settings-dialog .settings-checkbox { display: flex; align-items: center; gap: 10px; color: var(--ink); cursor: pointer; }
.settings-dialog .settings-checkbox input { flex: none; width: 20px; min-height: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.bathtub-status { margin: 12px 0 0; color: var(--muted); font-size: .82rem; }
.bathtub-status .semantic-photo { margin-left: 4px; }
.settings-dialog fieldset { margin: 18px 0 0; padding: 0; border: 0; }
.settings-dialog legend { font-weight: 700; font-size: .82rem; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.settings-span-2 { grid-column: span 2; }
.settings-buttons { justify-content: flex-end; margin-top: 20px; }
.settings-buttons button { min-height: 44px; padding: 10px 18px; }
.settings-error { min-height: 1.2em; color: #8f2f20; font-size: .82rem; }
.selected-dialog { width: min(760px, calc(100% - 24px)); overflow: hidden; }
.selected-dialog[open] { display: flex; flex-direction: column; }
.selected-heading, .selected-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.selected-heading { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.selected-heading h2 { margin: 0; font: 450 1.55rem/1 Georgia, serif; }
.selected-heading p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
.dialog-close, .selected-item-actions button { min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px 10px; font: 650 .82rem/1.2 system-ui, sans-serif; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.selected-empty { margin: 28px auto; max-width: 42ch; color: var(--muted); line-height: 1.55; text-align: center; }
.selected-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0; list-style: none; }
.selected-item { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.selected-item:last-child { border-bottom: 0; }
.selected-copy { min-width: 0; }
.selected-title-row { display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; }
.selected-copy h3 { margin: 0; font: 450 1.12rem/1.25 Georgia, serif; overflow-wrap: anywhere; }
.selected-rental-status { flex: none; margin-top: 1px; padding: 5px 7px; border-radius: 2px; background: #f1ded9; color: #7b281d; font: 750 .68rem/1 ui-monospace, monospace; letter-spacing: .035em; text-transform: uppercase; }
.selected-copy p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.selected-copy p:last-child { color: var(--ink); font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.selected-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; white-space: nowrap; }
.selected-item-actions a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); padding: 8px 0; font-size: .82rem; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.selected-footer { justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--line); }
.actions { width: min(620px, 100%); margin: 16px auto 0; display: grid; grid-template-columns: 48px 1fr 48px 1fr 48px; gap: 10px; }
.action { min-height: 48px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; border-radius: 3px; font: 650 .82rem/1 system-ui, sans-serif; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.action:disabled { cursor: wait; opacity: .58; }
.action.reject { color: #8f2f20; border-color: rgba(143,47,32,.35); }
.action.keep { color: var(--green); border-color: rgba(44,114,92,.38); }
.hint { color: var(--muted); text-align: center; font-size: .78rem; margin: 10px 0 0; }
@media (hover: hover) and (pointer: fine) {
  .quiet-button:hover, .selected-trigger:hover, .dialog-close:hover, .selected-item-actions button:hover { color: var(--ink); }
  .photo-nav:hover { background: rgba(10,12,11,.55); }
  .action:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(34,30,25,.10); }
}
@media (max-width: 920px) {
  .shell { width: 100%; padding: 0 0 calc(80px + env(safe-area-inset-bottom)); }
  .topbar { min-height: calc(88px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px 44px; grid-template-areas: "filter actions" "progress progress"; gap: 0 7px; position: sticky; top: 0; z-index: 10; background: rgba(242,239,232,.96); backdrop-filter: blur(14px); }
  .review-filter { grid-area: filter; min-width: 0; font-size: .75rem; line-height: 1.2; }
  .progress-copy { grid-area: progress; justify-self: center; gap: 7px; font-size: .75rem; white-space: nowrap; }
  .progress-copy strong { font-size: .8rem; white-space: nowrap; }
  .selected-trigger { font-size: .75rem; padding-inline: 2px; }
  .topbar-actions { grid-area: actions; }
  .quiet-button { min-width: 44px; min-height: 44px; padding: 6px; font-size: .75rem; }
  .topbar-actions .quiet-button { max-width: 76px; }
  .progress-track { position: sticky; top: calc(88px + env(safe-area-inset-top)); z-index: 11; margin: 0; }
  .deck { display: block; border: 0; border-radius: 0; min-height: 0; box-shadow: none; }
  .gallery { height: clamp(300px, 54svh, 520px); min-height: 0; }
  .gallery-head, .gallery-foot { left: 16px; right: 16px; }
  .facts { padding: 20px 16px 28px; max-height: none; }
  .headline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .headline > div:first-child { min-width: 0; }
  h1 { max-width: none; font-size: clamp(1.65rem, 8vw, 2rem); overflow-wrap: anywhere; }
  .vitals { margin: 24px 0 20px; }
  .score-card { margin-top: 20px; padding: 16px; }
  .score-row { align-items: baseline; font-size: .875rem; }
  .score-row span:last-child { flex: none; }
  .score-detail { font-size: .82rem; }
  summary { min-height: 48px; font-size: .9rem; }
  .description p, .evidence p, .original dd { font-size: 1rem; line-height: 1.6; }
  .semantic-details section div { flex-direction: column; gap: 4px; }
  .semantic-details section div span { align-self: flex-start; }
  .actions { position: fixed; z-index: 12; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); width: 100%; background: rgba(242,239,232,.97); border-top: 1px solid var(--line); backdrop-filter: blur(16px); grid-template-columns: 44px minmax(0, 1fr) 44px minmax(0, 1fr) 44px; gap: 6px; }
  .action { min-height: 56px; min-width: 0; }
  .hint { display: none; }
  .settings-dialog, .selected-dialog { padding: 18px; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .selected-dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .selected-item { grid-template-columns: 1fr; gap: 8px; }
  .selected-item-actions { justify-content: space-between; }
}
@media (max-width: 360px) {
  .actions { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); gap: 4px; }
  .action { font-size: .76rem; }
  .action.reject > span[aria-hidden], .action.keep > span[aria-hidden] { display: none; }
}
@media (max-width: 920px) and (max-height: 600px) {
  .gallery { height: min(68vw, calc(100svh - 104px)); min-height: 240px; max-height: 360px; }
}
@media (pointer: coarse) {
  .photo-nav { width: 48px; height: 64px; }
  .semantic-photo { min-height: 44px; }
  .action:active, .photo-nav:active, .semantic-photo:active, .selected-trigger:active, .source-link:active { filter: brightness(.92); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.rental-type-filters { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 4px 0 12px; }
.rental-type-filters .review-filter { min-height: 44px; }
#rental-filter-error { color: var(--ink); margin: 0 0 12px; }
