:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6471;
  --line: #d9dee6;
  --surface: #f6f7f9;
  --panel: #ffffff;
  --green: #207a57;
  --red: #b13d3d;
  --amber: #9b6a13;
  --blue: #1f5f91;
  --focus: #2f6fed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ria-credit {
  color: #155f90;
  font-size: 12px;
  font-weight: 800;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 38px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button:hover {
  border-color: #aab3bf;
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 84px);
}

.shell.filters-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.shell.filters-collapsed .filters {
  display: none;
}

.filters {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  background: #eef1f5;
  border-right: 1px solid var(--line);
}

.mobile-filter-header,
.filter-actions,
.filter-backdrop {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  color: #3b4552;
  font-size: 13px;
  font-weight: 650;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #3b4552;
  font-size: 13px;
  font-weight: 650;
}

.source-checklist {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #c9d0da;
  border-radius: 8px;
  background: #fff;
  max-height: 300px;
  overflow: auto;
}

label.source-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

label.source-option input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--blue);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9d0da;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

input,
select {
  min-height: 38px;
}

textarea {
  min-height: 110px;
  padding: 10px;
  line-height: 1.45;
  resize: vertical;
}

select[multiple] {
  min-height: 126px;
  padding: 6px;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid color-mix(in srgb, var(--focus) 40%, transparent);
  outline-offset: 2px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.content {
  padding: 20px 24px 32px;
  min-width: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 70px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.sort-control select {
  width: auto;
  min-width: 190px;
  color: var(--ink);
  font-weight: 700;
}

.feedback-toggle {
  color: var(--blue);
  font-weight: 750;
}

.theme-toggle {
  width: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.listings {
  display: grid;
  gap: 10px;
}

.load-more {
  display: block;
  width: min(100%, 360px);
  margin: 16px auto 0;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.load-more[hidden] {
  display: none;
}

.load-more:disabled {
  cursor: default;
  opacity: 0.55;
}

.listing {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) max-content;
  gap: 18px;
  align-items: stretch;
  min-height: 270px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgb(24 34 48 / 6%);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.listing:hover {
  border-color: #b9c5d2;
  box-shadow: 0 8px 22px rgb(24 34 48 / 11%);
  transform: translateY(-1px);
}

.listing-sold {
  background: #fff5f5;
  border-color: #e8baba;
  box-shadow: inset 5px 0 0 var(--red);
}

.listing-reserved {
  background: #fff9ea;
  border-color: #e8d5a8;
  box-shadow: inset 5px 0 0 var(--amber);
}

.listing-inactive {
  background: #f5f6f8;
  border-color: #cdd3dc;
  box-shadow: inset 5px 0 0 #7b8491;
}

.listing-sold .photo-hero img,
.listing-reserved .photo-hero img,
.listing-inactive .photo-hero img {
  filter: saturate(0.88);
}

.photo {
  position: relative;
  height: auto;
  width: 100%;
  min-width: 0;
  min-height: 270px;
  align-self: stretch;
  overflow: hidden;
  background: #dfe5ea;
}

.photo-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #d5dde6;
}

.photo-track,
.photo-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.photo-track {
  overflow: hidden;
}

.photo-slide {
  display: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #d5dde6;
}

.photo-slide:first-child {
  display: block;
}

.photo-primary,
.photo-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
  display: block;
}

.photo-primary {
  z-index: 1;
  transition: transform 180ms ease;
}

.photo-backdrop {
  display: none;
}

.photo-landscape .photo-backdrop {
  display: block;
  filter: blur(16px) brightness(0.72) saturate(0.85);
  transform: scale(1.1);
}

.photo-landscape .photo-primary {
  object-fit: contain;
  object-position: center;
}

.photo-slide:hover .photo-primary {
  transform: scale(1.025);
}

.photo-slide.photo-landscape:hover .photo-primary {
  transform: none;
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-counter {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgb(18 24 31 / 72%);
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.listing-main {
  display: grid;
  align-content: center;
  padding: 14px 0;
  min-width: 0;
}

.listing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.title-block {
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title {
  font-weight: 750;
  font-size: 20px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.title-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.title-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-left: 3px solid #ccd4df;
  color: #344051;
  padding-left: 8px;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}

.quick-facts {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(170px, max-content);
  gap: 12px;
  margin-top: 14px;
}

.quick-facts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 10px 12px;
}

.quick-facts div:nth-child(2) {
  border-color: #b9c7d6;
  background: #eef6ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.price-fact {
  cursor: pointer;
  outline: none;
}

.price-fact:hover {
  border-color: #6c9fc2 !important;
}

.price-fact:focus-visible,
.listing-excerpt-action:focus-visible {
  box-shadow: 0 0 0 3px rgb(30 109 160 / 24%);
}

.quick-facts span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-facts strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  line-height: 1.15;
}

.price-value {
  color: #123f63;
  font-size: 22px !important;
  font-weight: 900;
}

.market-chip {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-top: 7px;
  border: 1px solid #b9c3cf;
  border-radius: 5px;
  background: #fff;
  color: #445064 !important;
  padding: 3px 7px;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.15;
}

.market-chip-good {
  border-color: #84bba0;
  background: #e8f5ee;
  color: #17653f !important;
}

.market-chip-high {
  border-color: #dfbd72;
  background: #fff4d9;
  color: #7b510c !important;
}

.market-check {
  display: block;
  min-height: 0;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.market-check:disabled {
  color: var(--muted);
}

.update-badge {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border: 1px solid #d8c08b;
  border-radius: 8px;
  background: #fff8e7;
  padding: 9px 10px;
}

.update-badge span {
  color: #7c4f05;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.update-badge strong {
  color: #2c3138;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.update-badge em {
  color: #123f63;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.update-sold {
  border-color: #e8baba;
  background: #fff0f0;
}

.update-sold span {
  color: var(--red);
}

.update-reserved {
  border-color: #e8d5a8;
  background: #fff7df;
}

.update-inactive {
  border-color: #cdd3dc;
  background: #f2f4f7;
}

.update-inactive span {
  color: #5f6977;
}

.meta,
.source {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, max-content));
  gap: 8px;
  margin-top: 12px;
}

.spec,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
  background: #edf1f5;
  color: #344051;
}

.spec {
  gap: 6px;
}

.spec span {
  color: var(--muted);
  font-weight: 750;
}

.spec strong {
  color: var(--ink);
  font-weight: 850;
}

.spec-vin {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
}

.spec-vin strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.listing-excerpt {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: #596474;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.listing-excerpt-action {
  cursor: pointer;
  border-radius: 4px;
  outline: none;
}

.listing-excerpt-action:hover {
  color: #25364a;
}

.status.active {
  background: #e3f4ec;
  color: var(--green);
}

.status-stack {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 220px;
}

.status.stale {
  background: #fff2d8;
  color: #80540e;
  text-align: center;
}

.status.sold {
  background: #f8e5e5;
  color: var(--red);
}

.status.reserved {
  background: #fff2d8;
  color: var(--amber);
}

.status.inactive {
  background: #e8ebef;
  color: #5f6977;
}

.listing-side {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 8px;
  padding: 12px;
  border-left: 1px solid var(--line);
}

.price {
  font-size: 20px;
  font-weight: 800;
}

.source-link,
.telegram-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 750;
}

.source-link {
  white-space: nowrap;
}

.telegram-cta {
  margin-top: 10px;
}

.telegram-inline {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-size: inherit;
}

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgb(18 24 31 / 55%);
}

.feedback-dialog {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.feedback-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.feedback-form h2 {
  margin: 0 40px 2px 0;
  font-size: 21px;
}

.feedback-dialog textarea {
  font-size: 16px;
}

.feedback-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.feedback-types label {
  display: block;
  cursor: pointer;
}

.feedback-types input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.feedback-types span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 750;
}

.feedback-types input:checked + span {
  border-color: var(--blue);
  background: #edf6fc;
  color: #164f78;
}

.feedback-types input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--focus) 40%, transparent);
  outline-offset: 2px;
}

.feedback-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.feedback-status.success {
  color: var(--green);
}

.feedback-status.error {
  color: var(--red);
}

.feedback-submit {
  justify-self: end;
  min-width: 126px;
}

.feedback-toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  padding: 10px 14px;
  border-radius: 6px;
  background: #173f32;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 8px 24px rgb(18 24 31 / 22%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.feedback-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.telegram-preview {
  width: min(560px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 24px));
  overflow: hidden;
  background: #fff;
}

.telegram-preview-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 56px 0 16px;
}

.telegram-preview-body {
  min-height: 220px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  background: #edf2f6;
  padding: 10px;
}

.telegram-preview-body iframe {
  display: block;
  width: 100%;
  height: min(680px, calc(100vh - 180px));
  border: 0;
  background: #fff;
}

.telegram-preview-footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
}

.telegram-preview-footer .telegram-cta {
  margin: 0;
}

.telegram-preview-fallback {
  display: grid;
  align-content: center;
  min-height: 200px;
  background: #fff;
  padding: 24px;
  text-align: center;
}

.telegram-preview-fallback p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.list-end-sentinel {
  height: 1px;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  padding: 0;
  font-size: 22px;
}

.detail {
  padding: 22px;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.detail-photo {
  aspect-ratio: 4 / 3;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  background: #d5dde6;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.detail-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  overflow-wrap: anywhere;
}

.detail-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.market-panel {
  margin-top: 20px;
  border-block: 1px solid var(--line);
  padding: 16px 0;
}

.market-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.market-header h3 {
  margin: 0;
}

.market-header a {
  display: inline-block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
}

.market-result {
  margin-top: 14px;
}

.market-muted,
.market-error {
  color: var(--muted);
  font-size: 13px;
}

.market-error {
  color: var(--red);
}

.market-warning {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--amber);
  background: #fff6df;
  padding: 10px 12px;
}

.market-warning strong {
  color: #80540e;
}

.market-warning span {
  color: #66583c;
  font-size: 13px;
  line-height: 1.4;
}

.market-verdict {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-left: 4px solid #8793a3;
  padding: 8px 10px;
  background: #f2f4f7;
}

.market-verdict strong {
  font-size: 18px;
}

.market-verdict span {
  color: var(--muted);
  font-size: 12px;
}

.market-good {
  border-left-color: var(--green);
  background: #eaf6f0;
}

.market-good strong {
  color: var(--green);
}

.market-high {
  border-left-color: var(--amber);
  background: #fff6df;
}

.market-high strong {
  color: #80540e;
}

.market-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border-block: 1px solid var(--line);
}

.market-metrics div {
  padding: 10px;
  border-right: 1px solid var(--line);
}

.market-metrics div:last-child {
  border-right: 0;
}

.market-metrics span,
.market-metrics strong {
  display: block;
}

.market-metrics span {
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.market-metrics strong {
  margin-top: 4px;
  font-size: 15px;
}

.market-comparables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 12px;
  background: var(--line);
}

.market-comparable {
  display: grid;
  gap: 3px;
  min-width: 0;
  background: #fff;
  padding: 9px;
}

.market-comparable span {
  color: var(--muted);
  font-size: 11px;
}

.market-footnote {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.update-list {
  display: grid;
  gap: 8px;
}

.update-event {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.update-event div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.update-event strong {
  color: var(--ink);
}

.update-event span,
.update-event a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.update-event p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

pre {
  white-space: pre-wrap;
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.photo-viewer {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: #101820;
  border-color: #101820;
  overflow: hidden;
}

.photo-viewer img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 88px);
  object-fit: contain;
  background: #101820;
}

.photo-viewer .close {
  color: #fff;
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 20%);
}

.photo-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 56px;
  min-height: 0;
  border-color: rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 34px;
  transform: translateY(-50%);
}

.photo-nav.prev {
  left: 12px;
}

.photo-nav.next {
  right: 12px;
}

.viewer-count {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 750;
}

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

  .listing-side {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    justify-items: start;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  body.filters-visible {
    overflow: hidden;
  }

  .topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    min-height: 58px;
    padding: 9px 14px;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .topbar p {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  #filterToggle {
    min-height: 38px;
    border-color: #b9c3cf;
    font-weight: 750;
  }

  .shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 58px);
  }

  .filters {
    position: fixed;
    z-index: 100;
    inset: 0 auto 0 0;
    display: grid !important;
    grid-template-columns: 1fr;
    align-content: start;
    width: min(90vw, 390px);
    padding: 0 16px 18px;
    border: 0;
    border-right: 1px solid var(--line);
    background: #eef1f5;
    box-shadow: 12px 0 32px rgb(18 24 31 / 20%);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .shell.filters-open .filters {
    transform: translateX(0);
  }

  .mobile-filter-header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    margin: 0 -16px;
    border-bottom: 1px solid var(--line);
    background: #eef1f5;
    padding: 0 16px;
  }

  .mobile-filter-header strong {
    font-size: 18px;
  }

  .close-filter {
    width: 38px;
    padding: 0;
    font-size: 24px;
  }

  .filter-actions {
    position: sticky;
    bottom: -18px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 8px;
    margin: 4px -16px -18px;
    border-top: 1px solid var(--line);
    background: #eef1f5;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .filter-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: block;
    width: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    background: rgb(18 24 31 / 52%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .shell.filters-open .filter-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .stats {
    display: none;
  }

  .market-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-metrics div:nth-child(2) {
    border-right: 0;
  }

  .market-metrics div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .market-verdict {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .content {
    padding: 8px 10px 28px;
  }

  .toolbar {
    min-height: 34px;
    margin: 0 2px 8px;
  }

  .sort-control span {
    display: none;
  }

  .sort-control select {
    min-width: 174px;
  }

  .photo-track {
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .photo-track::-webkit-scrollbar {
    display: none;
  }

  .photo-slide,
  .photo-slide:first-child {
    position: relative;
    inset: auto;
    display: block;
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .photo-slide:hover .photo-primary {
    transform: none;
  }

  .listing {
    grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 9px 12px;
  }

  .content {
    padding: 8px 8px 24px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions button {
    min-height: 36px;
    padding: 0 9px;
  }

  .toolbar {
    align-items: center;
  }

  .toolbar > strong {
    font-size: 13px;
  }

  .sort-control select {
    width: min(52vw, 188px);
    min-width: 0;
    min-height: 36px;
    padding: 0 7px;
    font-size: 13px;
  }

  .feedback-form {
    padding: 20px 16px 16px;
  }

  .feedback-dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: auto;
  }

  .listing {
    grid-template-columns: 1fr;
  }

  .photo {
    height: auto;
    min-height: 240px;
    aspect-ratio: 4 / 3;
  }

  .photo-hero {
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .listing-main {
    padding: 12px;
  }

  .price-fact,
  .listing-excerpt-action {
    -webkit-tap-highlight-color: rgb(30 109 160 / 12%);
  }

  .status-stack {
    max-width: 148px;
  }

  .quick-facts {
    grid-template-columns: 1fr 1fr;
  }

  .specs {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eff3ef;
  --muted: #a6b0a8;
  --line: #3b443d;
  --surface: #121512;
  --panel: #1b201c;
  --green: #69c895;
  --red: #ef8d8d;
  --amber: #e7bd69;
  --blue: #79bce8;
  --focus: #8ac7ef;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] dialog,
html[data-theme="dark"] .telegram-preview,
html[data-theme="dark"] .telegram-preview-fallback {
  background: var(--panel);
  color: var(--ink);
}

html[data-theme="dark"] button,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: #465049;
  background: #242a25;
  color: var(--ink);
}

html[data-theme="dark"] button:hover {
  border-color: #69766c;
}

html[data-theme="dark"] .primary,
html[data-theme="dark"] .load-more {
  border-color: #dbe3dc;
  background: #dbe3dc;
  color: #172019;
}

html[data-theme="dark"] .filters,
html[data-theme="dark"] .mobile-filter-header,
html[data-theme="dark"] .filter-actions {
  background: #181d19;
}

html[data-theme="dark"] .filters label,
html[data-theme="dark"] .filter-group-header {
  color: #c6cec7;
}

html[data-theme="dark"] .source-checklist {
  border-color: #465049;
  background: #202621;
}

html[data-theme="dark"] label.source-option {
  color: var(--ink);
}

html[data-theme="dark"] .listing:hover {
  border-color: #59655c;
  box-shadow: 0 8px 22px rgb(0 0 0 / 28%);
}

html[data-theme="dark"] .listing-sold {
  border-color: #744747;
  background: #2b2020;
}

html[data-theme="dark"] .listing-reserved {
  border-color: #746337;
  background: #292619;
}

html[data-theme="dark"] .listing-inactive {
  border-color: #505851;
  background: #222622;
}

html[data-theme="dark"] .photo,
html[data-theme="dark"] .photo-hero,
html[data-theme="dark"] .photo-slide,
html[data-theme="dark"] .detail-photo {
  background: #303731;
}

html[data-theme="dark"] .title-meta span {
  border-color: #566158;
  color: #d5dcd6;
}

html[data-theme="dark"] .quick-facts div {
  background: #222823;
}

html[data-theme="dark"] .quick-facts div:nth-child(2) {
  border-color: #41647a;
  background: #1c2b34;
}

html[data-theme="dark"] .price-value,
html[data-theme="dark"] .update-badge em {
  color: #a7d7f5;
}

html[data-theme="dark"] .market-chip {
  border-color: #526058;
  background: #242b26;
  color: #d2d9d3 !important;
}

html[data-theme="dark"] .market-chip-good {
  border-color: #397151;
  background: #1b3325;
  color: #8ed7ac !important;
}

html[data-theme="dark"] .market-chip-high {
  border-color: #79652f;
  background: #352d18;
  color: #eccb82 !important;
}

html[data-theme="dark"] .update-badge,
html[data-theme="dark"] .market-warning,
html[data-theme="dark"] .market-high {
  border-color: #766333;
  background: #332c19;
}

html[data-theme="dark"] .update-badge span,
html[data-theme="dark"] .market-warning strong,
html[data-theme="dark"] .market-high strong {
  color: #efc979;
}

html[data-theme="dark"] .update-badge strong,
html[data-theme="dark"] .market-warning span {
  color: #e5e9e5;
}

html[data-theme="dark"] .update-sold {
  border-color: #744747;
  background: #342020;
}

html[data-theme="dark"] .update-reserved {
  border-color: #746337;
  background: #332c19;
}

html[data-theme="dark"] .update-inactive,
html[data-theme="dark"] .market-verdict,
html[data-theme="dark"] pre {
  border-color: #4b544d;
  background: #252a26;
}

html[data-theme="dark"] .spec,
html[data-theme="dark"] .status {
  background: #2a302b;
  color: #d5ddd6;
}

html[data-theme="dark"] .listing-excerpt {
  color: #b2bbb4;
}

html[data-theme="dark"] .listing-excerpt-action:hover {
  color: #e8ede9;
}

html[data-theme="dark"] .status.active,
html[data-theme="dark"] .market-good {
  background: #1c3526;
}

html[data-theme="dark"] .status.stale,
html[data-theme="dark"] .status.reserved {
  background: #392f19;
  color: #edc674;
}

html[data-theme="dark"] .status.sold {
  background: #3a2323;
}

html[data-theme="dark"] .status.inactive {
  background: #2b302c;
  color: #b4bdb5;
}

html[data-theme="dark"] .source-link,
html[data-theme="dark"] .telegram-cta,
html[data-theme="dark"] .feedback-types span {
  background: #242a25;
}

html[data-theme="dark"] .feedback-types input:checked + span {
  border-color: var(--blue);
  background: #1c303c;
  color: #a8d9f5;
}

html[data-theme="dark"] .telegram-preview-body {
  background: #141815;
}

html[data-theme="dark"] .telegram-preview-body iframe {
  background: #fff;
}

html[data-theme="dark"] .market-comparable,
html[data-theme="dark"] .update-event {
  background: #222823;
}

html[data-theme="dark"] .feedback-toast {
  background: #8ed7ac;
  color: #112219;
}
