:root {
  --bg: #303030;
  --surface: #424242;
  --surface-strong: #393939;
  --surface-soft: #4c4c4c;
  --line: #616161;
  --text: #f5f5f5;
  --muted: #c6c6c6;
  --subtle: #9f9f9f;
  --accent: #ff436f;
  --accent-hover: #ff6387;
  --warning: #f5c451;
  --error: #ff8a9f;
  --success: #72d3a1;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #191818; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

button, input, select { font: inherit; letter-spacing: 0; }
button, a, summary, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(255, 67, 111, 0.45);
  outline-offset: 2px;
}

.is-hidden { display: none !important; }

.page-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 8px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(25, 24, 24, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.main-content {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(18px, 4vh, 52px) 0 40px;
  flex: 1;
}

.search-view { width: min(760px, 100%); margin: 0 auto; }
.search-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(66, 66, 66, 0.96);
  box-shadow: var(--shadow);
}

.panel-heading { padding: 28px 32px 18px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
h1 { margin: 0; font-size: 26px; line-height: 1.3; }
.panel-heading > p:last-child, .result-summary { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }

#search-form { padding: 0 32px 30px; }
.drop-zone {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 258px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  cursor: pointer;
  border: 2px dashed #858585;
  border-radius: 6px;
  color: var(--text);
  background: rgba(48, 48, 48, 0.64);
  transition: border-color 160ms ease, background 160ms ease;
}
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--accent); background: rgba(255, 67, 111, 0.08); }
.drop-zone strong { font-size: 19px; }
.drop-zone > span:last-of-type { color: var(--muted); font-size: 14px; }
.upload-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}
.query-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #292929;
}

.search-controls { display: grid; gap: 18px; margin-top: 22px; }
.factor-control { margin: 0; padding: 0; border: 0; }
.factor-control legend, .advanced-grid label > span { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: grid;
  min-height: 44px;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-strong);
}
.segmented label:first-of-type { border-radius: 5px 0 0 5px; }
.segmented label:last-of-type { border-radius: 0 5px 5px 0; border-left: 0; }
.segmented input:checked + label { border-color: var(--accent); color: #fff; background: rgba(255, 67, 111, 0.18); }

.advanced-options { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced-options summary { padding: 13px 2px; cursor: pointer; color: var(--muted); font-size: 14px; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 2px 0 16px; }
.advanced-grid label { display: grid; }
select, input[type="number"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 11px;
  color: var(--text);
  background: #333;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 750;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.button:disabled { cursor: not-allowed; opacity: 0.42; }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-quiet { border-color: var(--line); color: var(--text); background: #383838; }
.button-quiet:hover { border-color: #8c8c8c; background: #464646; }

.notice { margin: 18px 32px 28px; border-left: 3px solid; border-radius: 3px; padding: 13px 15px; line-height: 1.55; }
.notice-error { border-color: var(--error); color: #ffe5eb; background: rgba(255, 86, 117, 0.12); }
.notice-warning { margin: 16px 0; border-color: var(--warning); color: #ffe9ad; background: rgba(245, 196, 81, 0.1); }

.content-slot { display: grid; gap: 12px; margin: 20px 0; }
.results-view .content-slot { width: min(900px, 100%); margin-right: auto; margin-left: auto; }
.content-item { display: block; overflow: hidden; border-radius: 5px; background: #252525; opacity: .6; transition: opacity 150ms ease; }
.content-item:hover { opacity: 1; }
.content-desktop, .content-mobile { display: block; }
.content-mobile { display: none; }
.content-item img, .content-item video { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.content-item .content-ratio-wide { aspect-ratio: 900 / 138; }
.content-item .content-ratio-mobile { aspect-ratio: 900 / 300; }

.results-view { width: 100%; }
.results-toolbar { display: grid; grid-template-columns: minmax(92px, 1fr) minmax(0, 2fr) minmax(92px, 1fr); align-items: center; gap: 12px; width: min(900px, 100%); margin: 0 auto 16px; }
.result-overview { min-width: 0; text-align: center; }
.result-overview h1 { margin: 0; color: var(--text); font-size: clamp(19px, 2.2vw, 28px); line-height: 1.25; }
.result-meta { margin: 5px 0 0; overflow: hidden; color: var(--subtle); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.result-nav-button { min-width: 0; padding: 5px 2px; cursor: pointer; border: 0; color: var(--muted); background: transparent; font-size: 14px; font-weight: 650; white-space: nowrap; }
.result-nav-button:hover { color: var(--accent); }
.result-nav-back { justify-self: start; color: var(--accent); }
.result-nav-copy { justify-self: end; }
.loading-state {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #616161;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-list { display: grid; gap: 14px; }
.tag-display-toggle {
  display: block;
  margin: 10px auto 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}
.tag-display-toggle:hover { border-color: var(--accent); color: var(--text); }
.result-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(66, 66, 66, 0.97);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
.result-image-wrap { position: relative; width: fit-content; max-width: min(400px, 100%); min-width: 0; background: transparent; }
.result-image-link { display: block; width: fit-content; max-width: 100%; height: auto; color: inherit; line-height: 0; text-decoration: none; }
.result-image { display: block; width: auto; height: auto; max-width: min(400px, 100%); max-height: 400px; object-fit: contain; object-position: center; }
.image-fallback { display: grid; width: 100%; height: 100%; min-height: 250px; place-items: center; padding: 20px; color: var(--subtle); text-align: center; }
.score-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border-radius: 4px;
  color: #fff;
  background: rgba(22, 22, 22, 0.88);
  font-size: 13px;
  font-weight: 800;
}
.result-body { min-width: 0; padding: 20px 22px; }
.source-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.source-name { color: var(--accent); font-weight: 800; }
.metadata-state { padding: 2px 6px; border-radius: 3px; color: #d2d2d2; background: #353535; }
.same-image-count { color: var(--success); font-weight: 700; }
.result-title { margin: 10px 0 4px; overflow-wrap: anywhere; font-size: 19px; line-height: 1.45; }
.result-alt { margin: 0 0 14px; overflow-wrap: anywhere; color: var(--muted); font-size: 14px; line-height: 1.5; }
.metadata-rows { display: grid; gap: 8px; margin: 13px 0; }
.metadata-row { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.5; }
.metadata-label { color: var(--subtle); }
.metadata-value { min-width: 0; overflow-wrap: anywhere; color: #e9e9e9; }
.language-value { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.language-icon { display: inline-flex; flex: 0 0 auto; width: 24px; height: 16px; border-radius: 2px; overflow: hidden; vertical-align: -0.15em; }
.language-text { min-width: 0; overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { max-width: 100%; overflow-wrap: anywhere; border: 1px solid #626262; border-radius: 3px; padding: 3px 7px; color: #ddd; background: #383838; font-size: 12px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.result-actions .button { min-height: 36px; padding: 0 13px; font-size: 13px; }
.same-image-sources { display: grid; gap: 8px; margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.09); padding-top: 12px; }
.same-image-label { color: var(--subtle); font-size: 12px; font-weight: 700; }
.source-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.source-chip {
  display: inline-flex;
  min-height: 32px;
  max-width: 100%;
  align-items: center;
  overflow-wrap: anywhere;
  border: 1px solid #6d6d6d;
  border-radius: 4px;
  padding: 5px 10px;
  color: #f0f0f0;
  background: #373737;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.source-chip:hover { border-color: var(--accent); background: #454545; }
.source-chip-disabled { cursor: not-allowed; color: var(--subtle); border-style: dashed; }
.raw-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.raw-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.raw-json { max-height: 330px; overflow: auto; margin: 10px 0 0; border-radius: 4px; padding: 12px; color: #d8d8d8; background: #252525; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.low-results { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(48, 48, 48, 0.78); }
.low-results > summary { padding: 16px 18px; cursor: pointer; color: var(--muted); font-weight: 700; }
.low-results-list { display: grid; gap: 14px; border-top: 1px solid var(--line); padding: 14px; }
.empty-state { padding: 50px 24px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); text-align: center; }
.site-footer { padding: 38px 16px 22px; color: #858585; font-size: 12px; text-align: center; }

/* Homepage layout mirrors the legacy PHP hero: artwork, transparent uploader,
   explanatory copy, then the configured creatives and footer links. */
.legacy-home { width: min(900px, 100%); margin: 0 auto; }
.legacy-home #search-form { padding: 0; }
.legacy-hero { display: flex; align-items: stretch; gap: 24px; }
.hero-art { flex: 0 0 31%; overflow: hidden; aspect-ratio: 2 / 3; border-radius: 10px; box-shadow: var(--shadow); }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.legacy-upload-card { min-width: 0; flex: 1; padding: 20px; border-radius: 12px; background: rgba(66, 66, 66, 0.44); box-shadow: var(--shadow); backdrop-filter: blur(8px) saturate(115%); }
.drop-zone { display: flex; width: 100%; min-height: 390px; align-items: center; justify-content: center; cursor: pointer; border: 1px dashed #858585; border-radius: 8px; color: var(--muted); background: rgba(48, 48, 48, 0.2); transition: border-color 160ms ease, background 160ms ease; }
.drop-zone:hover, .drop-zone.is-dragging, .drop-zone:focus-visible { border-color: var(--accent); background: rgba(255, 67, 111, 0.08); }
.drop-copy { display: flex; align-items: center; flex-direction: column; gap: 10px; text-align: center; }
.drop-copy > span:not(.drop-icon) { color: #888; line-height: 1.6; }
.drop-copy strong { color: var(--accent); }
.drop-icon { width: 58px; height: 58px; color: #707070; }
.drop-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.legacy-mode-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 20px 0 0; color: var(--muted); }
.mode-help { display: inline-grid; width: 18px; height: 18px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; cursor: help; }
.legacy-switch input { position: absolute; opacity: 0; pointer-events: none; }
.legacy-switch-track { display: inline-flex; min-width: 66px; height: 24px; align-items: center; gap: 4px; padding: 3px 7px 3px 3px; border-radius: 999px; color: #fff; background: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.legacy-switch-knob { width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 150ms ease; }
.legacy-switch input:checked + .legacy-switch-track { background: #6366f1; }
.legacy-switch input:checked + .legacy-switch-track .legacy-switch-knob { transform: translateX(38px); }
.legacy-submit { display: none; }
.legacy-intro { margin: 16px auto 0; color: var(--muted); text-align: center; line-height: 1.8; }
.legacy-intro p { margin: 2px 0; }
.legacy-content-slot { margin-top: 18px; }
.legacy-content-slot .content-item { opacity: 1; border-radius: 6px; }
.legacy-content-slot .content-item img, .legacy-content-slot .content-item video { max-height: none; }
.footer-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: #a4a4a4; }
.footer-link { display: flex; min-width: 64px; align-items: center; flex-direction: column; gap: 3px; padding: 0 5px; color: inherit; text-decoration: none; opacity: .7; transition: opacity 150ms ease; }
.footer-link:hover { opacity: 1; }
.footer-icon { display: block; width: 34px; height: 34px; object-fit: contain; }
.footer-icon-telegram { fill: #2aabee; }
.footer-icon-telegram path { fill: #fff; }
.footer-icon-github { fill: currentColor; }
.footer-icon-image { border-radius: 3px; }
.footer-icon-link { display: grid; place-items: center; font-size: 26px; }
.footer-separator { margin: 0 1px; color: #858585; }
.footer-meta { display: flex; align-items: center; flex-direction: column; gap: 4px; margin-top: 10px; color: #6f6f6f; }
.result-query { display: flex; align-items: center; flex-direction: column; gap: 6px; margin: 0 auto 14px; color: var(--muted); font-size: 13px; }
.result-query-image { display: block; width: auto; height: auto; max-width: min(100%, 900px); max-height: none; object-fit: contain; border: 1px solid var(--accent); border-radius: 6px; background: #222; }

@media (max-width: 720px) {
  .site-header { min-height: 52px; padding: 7px 16px; }
  .main-content { width: min(calc(100% - 20px), 1120px); padding-top: clamp(8px, 2vh, 20px); padding-bottom: 20px; }
  .panel-heading { padding: 22px 19px 15px; }
  h1 { font-size: 22px; }
  #search-form { padding: 0 18px 22px; }
  .drop-zone { min-height: 220px; padding: 18px; }
  .advanced-grid { grid-template-columns: 1fr; }
  .notice { margin-right: 18px; margin-left: 18px; }
  .notice-warning { margin-right: 0; margin-left: 0; }
  .results-toolbar { grid-template-columns: minmax(72px, 1fr) minmax(0, 2fr) minmax(72px, 1fr); gap: 5px; margin-bottom: 12px; }
  .result-nav-button { font-size: 13px; }
  .result-overview h1 { font-size: 18px; }
  .result-meta { margin-top: 3px; font-size: 10px; }
  .result-actions .button { min-height: 44px; }
  .source-chip { min-height: 44px; }
  .result-card { grid-template-columns: auto minmax(0, 1fr); }
  .result-image-wrap, .result-image, .image-fallback { min-height: 0; }
  .result-body { padding: 15px 14px; }
  .result-title { font-size: 16px; }
  .metadata-row { grid-template-columns: 52px minmax(0, 1fr); font-size: 13px; }
  .result-actions .button { flex: 1 1 120px; }
  .legacy-hero { flex-direction: column; gap: 10px; }
  .hero-art { width: 100%; flex-basis: auto; aspect-ratio: 3 / 2; }
  .legacy-upload-card { padding: 8px; }
  .legacy-upload-card .drop-zone { height: clamp(180px, 30vh, 250px); min-height: 0; padding: 12px; }
  .drop-icon { width: 46px; height: 46px; }
  .drop-copy { gap: 7px; }
  .legacy-mode-row { margin-top: 12px; }
  .legacy-intro { margin-top: 12px; line-height: 1.55; }
  .legacy-content-slot { margin-top: 10px; }
}

/* Small-screen baseline. The final mobile rule below applies the old PHP
   overlap geometry after this fallback has established the compact scale. */
@media (max-width: 720px) and (max-height: 1024px) {
  .legacy-hero { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-art { width: 100%; height: clamp(180px, 24vh, 260px); aspect-ratio: auto; }
  .legacy-upload-card { width: 100%; height: auto; padding: 8px; }
  .legacy-upload-card .drop-zone { height: clamp(160px, 22vh, 240px); min-height: 0; padding: 12px; }
  .drop-icon { width: 46px; height: 46px; }
  .drop-copy { gap: 7px; font-size: 14px; }
  .drop-copy > span:not(.drop-icon) { line-height: 1.5; }
  .legacy-mode-row { margin-top: 12px; font-size: 15px; }
  .legacy-intro { margin-top: 12px; font-size: 14px; line-height: 1.55; }
  .legacy-content-slot { margin-top: 10px; gap: 8px; }
}

/* Match the legacy PHP phone composition: the artwork is a full-width
   backdrop and the upload panel overlaps its lower half. */
@media (max-width: 720px) {
  /* The PHP mobile page uses the viewport edge for the artwork.  Keeping
     the content shell inset here makes the hero visibly narrower than the
     legacy page and also pushes the configured banners down. */
  .main-content { width: 100%; padding-top: 0; padding-right: 0; padding-left: 0; }
  .search-view.legacy-home { width: 100%; }
  .legacy-home #search-form { padding: 0 0 22px; }
  .legacy-hero { position: relative; display: block; width: 100%; height: clamp(400px, 110vw, 500px); overflow: visible; }
  .legacy-hero .hero-art { position: absolute; inset: 0 0 auto; width: 100%; height: 56.25vw; aspect-ratio: 16 / 9; border-radius: 0 0 12px 12px; }
  .legacy-hero .legacy-upload-card { position: absolute; z-index: 2; top: calc(56.25vw - 64px); left: 4%; width: 92%; height: auto; box-sizing: border-box; padding: 16px; border-radius: 14px; }
  .legacy-hero .legacy-upload-card .drop-zone { height: 240px; min-height: 0; padding: 8px; }
  .legacy-mode-row { margin-top: 16px; font-size: 15px; }
  .legacy-intro { width: calc(100% - 40px); margin-top: 12px; font-size: 14px; line-height: 1.55; }
  .legacy-content-slot { width: calc(100% - 40px); margin-right: auto; margin-left: auto; gap: 8px; }
}

/* Very short phone content viewports (browser chrome included) still keep
   both configured banners visible without changing the legacy vertical order. */
@media (max-width: 720px) and (max-height: 720px) {
  .main-content { padding-top: 8px; padding-bottom: 12px; }
  .legacy-hero { height: clamp(400px, 110vw, 500px); }
  .legacy-hero .hero-art { height: 56.25vw; }
  .legacy-hero .legacy-upload-card { top: calc(56.25vw - 64px); padding: 16px; }
  .legacy-hero .legacy-upload-card .drop-zone { height: 240px; padding: 8px; }
  .drop-icon { width: 30px; height: 30px; }
  .drop-copy { gap: 3px; font-size: 11px; }
  .drop-copy > span:not(.drop-icon) { line-height: 1.25; }
  .legacy-mode-row { margin-top: 6px; font-size: 12px; }
  .legacy-intro { margin-top: 6px; font-size: 11px; line-height: 1.3; }
  .legacy-content-slot { margin-top: 6px; gap: 6px; }
}

/* Apply the same viewport-height budget to desktop windows that have been
   pulled short. The legacy two-column hero stays aligned while its shared
   height and surrounding copy shrink enough to keep both banners in view. */
@media (min-width: 721px) and (max-height: 900px) {
  .main-content { padding-top: clamp(8px, 3vh, 28px); padding-bottom: 20px; }
  .legacy-hero { height: clamp(170px, 28vh, 270px); }
  .hero-art, .legacy-upload-card { height: 100%; aspect-ratio: auto; }
  .legacy-upload-card { padding: clamp(8px, 1.5vw, 16px); }
  .legacy-upload-card .drop-zone { height: 100%; min-height: 0; padding: 12px; }
  .drop-icon { width: clamp(40px, 5vw, 58px); height: clamp(40px, 5vw, 58px); }
  .drop-copy { gap: 7px; }
  .legacy-mode-row { margin-top: 10px; }
  .legacy-intro { margin-top: 10px; font-size: 13px; line-height: 1.45; }
  .legacy-content-slot { margin-top: 10px; gap: 8px; }
}

@media (max-width: 639px) {
  .content-desktop { display: none; }
  .content-mobile { display: block; }
}

@media (max-width: 460px) {
  .result-card { display: block; }
  .result-image-wrap, .result-image, .image-fallback { min-height: 0; height: auto; }
  .result-image-wrap { max-width: 100%; margin-right: auto; margin-left: auto; }
  .result-image { object-fit: contain; }
  .result-query-image { max-width: 100%; max-height: none; }
}

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