/* Полигон — a quiet, image-first marketplace. No runtime fonts or UI dependencies. */
:root {
  --ink: #11151c;
  --muted: #747b8a;
  --line: #e3e6eb;
  --soft: #f3f4f6;
  --accent: #c8e873;
  --accent-hover: #b9db60;
  --green: #496d25;
  --pale: #edf4df;
  --paper: #fff;
  --radius: 8px;
  font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { color: inherit; }
img { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 36px; line-height: 1.16; letter-spacing: -1.05px; margin-bottom: 8px; font-weight: 750; }
h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.45px; }
h3 { font-size: 16px; }
p:last-child { margin-bottom: 0; }
.icon { width: 24px; height: 24px; flex: 0 0 auto; vertical-align: middle; }
.shell { max-width: 1480px; margin: 0 auto; padding-inline: 36px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 46px; padding: 11px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; font-weight: 600; font-size: 14px; text-align: center; }
.button:hover { background: var(--soft); color: var(--ink); }
.primary { border-color: transparent; background: var(--accent); color: #101508; }
.primary:hover { border-color: transparent; background: var(--accent-hover); color: #101508; }
.plain-button { border: 0; background: none; padding: 10px 0; }
/* The two-line navigation stays compact so results own the first screen. */
.site-header { border-bottom: 1px solid var(--line); background: white; }
.header-main { min-height: 84px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; font-size: 27px; font-weight: 900; letter-spacing: -.8px; text-transform: uppercase; line-height: 1; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { display: flex; gap: 5px; width: 36px; height: 29px; padding: 1px 4px; transform: skew(-24deg); }
.brand-mark::before, .brand-mark::after { content: ""; width: 11px; background: #87ad44; border-radius: 1px; }
.brand-mark::after { background: #496d25; }
.catalog-button { white-space: nowrap; gap: 13px; }
.catalog-button .icon { width: 20px; }
.header-search { height: 46px; display: flex; flex: 1; min-width: 140px; border: 1px solid #d4d8e0; border-radius: var(--radius); background: white; }
.header-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px var(--pale); }
.header-search input { width: 100%; min-width: 0; padding: 11px 14px; border: 0; border-radius: inherit; background: transparent; font-size: 14px; }
.header-search input:focus-visible { outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.header-search button { width: 46px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: var(--radius); background: transparent; }
.header-search button:hover { background: var(--soft); }
.region-picker { position: relative; flex-shrink: 0; font-size: 14px; }
.region-picker summary { display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; }
.region-picker summary::-webkit-details-marker, .filter-panel summary::-webkit-details-marker { display: none; }
.region-picker summary span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-picker summary .icon:last-child { width: 14px; }
.region-popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 15; width: 300px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px #17201216; }
.region-popover .button { width: 100%; }
.account-nav, .favorites-link { display: flex; align-items: center; }
.account-nav { gap: 18px; font-size: 14px; }
.account-nav form { margin: 0; }
.favorites-link { gap: 9px; min-height: 44px; white-space: nowrap; }
.account-login { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 44px; font-size: 14px; }
.account-login .icon { width: 21px; }
.category-nav { display: flex; align-items: stretch; gap: 48px; min-height: 49px; overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav a { position: relative; padding-block: 11px 16px; white-space: nowrap; font-size: 15px; }
.category-nav a[aria-current] { font-weight: 600; }
.category-nav a[aria-current]::after { content: ""; position: absolute; bottom: 0; height: 3px; left: 0; right: 0; background: #82a941; border-radius: 3px; }
.main-content { padding-top: 25px; padding-bottom: 70px; min-height: 70vh; }
.demo-notice { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; color: #72796c; font-size: 12px; }
.demo-tag, .card-demo { font-size: 10px; letter-spacing: .6px; font-weight: 700; padding: 3px 6px; background: var(--pale); color: var(--green); border-radius: 4px; white-space: nowrap; }
/* Catalog: four desktop columns, larger two-column cards on touch surfaces. */
/* A tall, spanning sidebar must not expand the heading and toolbar rows. */
.catalog-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "filters heading" "filters toolbar" "filters results"; column-gap: 30px; align-items: start; position: relative; }
.page-heading { grid-area: heading; margin-bottom: 18px; min-width: 0; }
.result-count { color: #686f7e; font-size: 16px; margin: 0; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.breadcrumbs .icon { width: 13px; height: 13px; color: #a0a6b0; }
.breadcrumbs a { color: var(--green); }
.filter-panel { grid-area: filters; min-width: 0; padding-right: 22px; border-right: 1px solid #eceef1; }
.filter-panel > summary { display: none; }
.filter-heading h2 { font-size: 16px; letter-spacing: 0; margin: 3px 0 13px; }
.category-options { margin-bottom: 28px; }
.category-option { display: flex; align-items: center; gap: 8px; position: relative; min-height: 38px; cursor: pointer; font-size: 14px; }
.category-option span { flex: 1; }
.category-option .icon { width: 13px; height: 13px; }
.category-option:hover { color: var(--green); }
.category-tree { list-style: none; margin: 0; padding: 0; min-width: 0; }
.category-tree .category-tree { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.category-root > .category-branch > summary > .category-option { font-weight: 600; }
.category-branch > summary { display: flex; align-items: center; list-style: none; border-radius: 6px; }
.category-branch > summary::-webkit-details-marker { display: none; }
.category-branch > summary .category-option { flex: 1; min-width: 0; }
.category-option span { overflow-wrap: anywhere; }
.category-toggle { display: flex; align-items: center; justify-content: center; flex: 0 0 36px; align-self: stretch; min-height: 38px; color: var(--muted); }
.category-toggle .icon { width: 13px; height: 13px; }
.category-branch[open] > summary > .category-toggle .icon { transform: rotate(90deg); }
.category-branch > summary:hover .category-toggle { color: var(--green); }
.filter-group { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.filter-group legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 10px; }
.filter-options { display: flex; flex-direction: column; gap: 1px; }
.filter-option { display: flex; align-items: center; gap: 10px; min-height: 33px; font-size: 14px; cursor: pointer; }
.filter-option input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--green); }
.filter-option span { overflow-wrap: anywhere; }
.field { margin-bottom: 17px; min-width: 0; }
.field > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field input, .field select, .field textarea, select { width: 100%; min-height: 44px; max-width: 100%; background: white; border: 1px solid #d8dce4; border-radius: 6px; padding: 10px 12px; color: var(--ink); font-size: 14px; }
.field textarea { resize: vertical; }
.field input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--green); }
.field-invalid input, .field-invalid select, .field-invalid textarea { border-color: #b4493d; }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-range .field > label { font-size: 12px; font-weight: 400; color: var(--muted); }
.price-range .field { margin-bottom: 12px; }
.help-text { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 9px 0 0; overflow-wrap: anywhere; }
.help-text ul { padding-left: 16px; }
.errorlist { list-style: none; padding: 0; color: #a6372e; font-size: 14px; margin: 6px 0; }
.required { color: var(--green); }
.filter-submit { width: 100%; }
.reset-link { display: block; color: var(--green); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; margin-top: 20px; }
.results-toolbar { grid-area: toolbar; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; min-width: 0; }
.source-control { min-width: 0; max-width: 100%; }
.source-control select { width: auto; max-width: 270px; }
.source-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 3px; scrollbar-width: thin; max-width: 100%; }
.source-tab { flex: 0 0 auto; max-width: 210px; padding: 10px 16px; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tab[aria-pressed=true] { background: var(--accent); border-color: transparent; color: #101508; }
.source-tab:hover { border-color: var(--green); }
.sort-control { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.sort-control > .icon { width: 20px; }
.sort-control select { width: 190px; min-height: 42px; font-size: 14px; }
.small { min-height: 42px; font-size: 14px; padding: 8px 12px; }
.catalog-main { grid-area: results; min-width: 0; }
.filter-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.filter-chips a { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; background: var(--pale); border-radius: 7px; padding: 8px 12px; min-height: 38px; font-size: 14px; overflow-wrap: anywhere; }
.filter-chips .icon { width: 16px; height: 16px; }
.filter-chips .clear-chips { background: none; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.lot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 16px; }
.lot-card { min-width: 0; }
.card-media { aspect-ratio: 1.17; position: relative; overflow: hidden; border-radius: 7px; background: var(--soft); }
.image-link { display: block; width: 100%; height: 100%; }
.image-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
@media(hover:hover) { .lot-card:hover .image-link img { transform: scale(1.025); } }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 100%; min-height: 120px; padding: 18px; color: #7b827b; background: #f0f1ed; text-align: center; font-size: 14px; }
.photo-placeholder > .icon { width: 40px; height: 40px; color: #aab0a2; stroke-width: 1; margin-bottom: 4px; }
.photo-placeholder small { font-size: 12px; }
.card-demo { position: absolute; top: 10px; left: 10px; background: #ffffffeb; }
.favorite-form { margin: 0; }
.card-media > .favorite-form { position: absolute; top: 7px; right: 7px; }
.favorite-button { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 8px; border: 0; border-radius: 50%; background: #fffffffa; color: var(--ink); }
.favorite-button .icon { width: 23px; height: 23px; }
.favorite-button:hover { color: var(--green); background: var(--pale); }
.favorite-button.selected { color: var(--green); }
.favorite-button.selected .icon { fill: var(--green); }
.card-content { padding: 9px 1px 0; }
.card-price { font-size: 22px; line-height: 1.25; font-weight: 750; letter-spacing: -.5px; margin-bottom: 5px; overflow-wrap: anywhere; }
.lot-card h2 { font-size: 16px; line-height: 1.4; font-weight: 400; letter-spacing: -.15px; margin-bottom: 7px; overflow-wrap: anywhere; }
.lot-card h2 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-location, .card-meta { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 0 2px; overflow-wrap: anywhere; }
.card-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.card-status { display: inline-block; background: var(--soft); color: #5d626b; border-radius: 4px; padding: 2px 6px; margin-top: 6px; font-size: 12px; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 38px; }
.pagination a { display: grid; place-items: center; min-width: 40px; height: 42px; border-radius: 6px; padding: 0 9px; font-size: 14px; }
.pagination a:hover { background: var(--soft); }
.pagination a[aria-current] { background: var(--accent); font-weight: 600; color: #101508; }
.pagination a[aria-label] { border: 1px solid var(--line); }
/* Detail and shared states. */
.detail-heading { margin-bottom: 24px; }
.detail-heading h1 { font-size: 36px; overflow-wrap: anywhere; }
.detail-heading p { color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; align-items: start; }
.detail-main { min-width: 0; }
.gallery { margin: 0 0 32px; }
.gallery-primary, .detail-placeholder { position: relative; width: 100%; aspect-ratio: 1.65; overflow: hidden; border-radius: 9px; background: var(--soft); }
.gallery-primary img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbnails { display: flex; gap: 12px; overflow-x: auto; margin-top: 12px; padding: 3px; }
.gallery-thumbnails a { flex: 0 0 calc((100% - 36px) / 4); border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: var(--soft); }
.gallery-thumbnails a[aria-current] { border-color: var(--accent); }
.gallery-thumbnails img { width: 100%; aspect-ratio: 1.35; height: auto; object-fit: cover; }
.gallery-step { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; background: #ffffffdd; border-radius: 50%; display: grid; place-items: center; }
.gallery-prev { left: 16px; }
.gallery-prev .icon { transform: rotate(180deg); }
.gallery-next { right: 16px; }
.gallery-counter { position: absolute; left: 16px; bottom: 14px; padding: 3px 12px; border-radius: 20px; background: #11151c99; color: white; font-size: 14px; }
.purchase-panel { position: sticky; top: 24px; }
.detail-price { font-size: 42px; font-weight: 750; letter-spacing: -1px; line-height: 1.15; margin: 0 0 14px; overflow-wrap: anywhere; }
.status-label, .condition-label { display: inline-block; font-size: 14px; border-radius: 30px; padding: 4px 13px; margin: 0 5px 16px 0; background: var(--soft); color: #58616c; }
.status-label.status-active, .condition-label { background: var(--pale); color: #223215; }
.detail-location { display: flex; align-items: center; gap: 10px; margin: 2px 0 23px; }
.detail-location .icon { width: 20px; height: 20px; }
.purchase-source { padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.purchase-source > p { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.source-dates { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.purchase-source .source-dates { flex-direction: column; }
.source-actions { margin: 24px 0; }
.source-link { display: flex; width: 100%; font-size: 16px; min-height: 50px; margin-bottom: 6px; }
.source-link-caption { display: block; text-align: center; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.detail-save .favorite-button { gap: 12px; width: 100%; min-height: 48px; height: auto; justify-content: flex-start; border-radius: 6px; padding: 10px; font-size: 16px; }
.detail-save .favorite-button .icon { width: 25px; height: 25px; }
.report-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px; margin-top: 13px; font-size: 16px; }
.purchase-disclaimer { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 24px; }
.detail-section { margin: 0 0 32px; }
.detail-section h2 { margin-bottom: 12px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.section-heading h2 { margin-bottom: 12px; }
.auto-badge { color: var(--muted); font-size: 14px; }
.characteristics { margin: 0 0 20px; }
.characteristics > div { display: grid; grid-template-columns: 43% minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.characteristics dt { color: #676e7b; }
.characteristics dd { margin: 0; overflow-wrap: anywhere; }
.characteristic-group-title { font-size: 14px; color: var(--muted); font-weight: 400; margin-bottom: 2px; }
.original-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.65; }
.source-description + .source-description { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.source-description h3 { margin-bottom: 10px; }
.source-record { margin-bottom: 20px; }
.source-record > p { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.info-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 7px; background: var(--soft); font-size: 14px; line-height: 1.6; }
.info-note .icon { color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }
.empty-state { padding: 65px 24px; text-align: center; border: 1px solid var(--line); border-radius: 10px; }
.empty-state > .icon { width: 42px; height: 42px; color: var(--muted); margin-bottom: 18px; }
.empty-state p { max-width: 440px; margin-inline: auto; color: var(--muted); }
.notice, .messages { border-radius: 8px; padding: 15px 18px; margin-bottom: 22px; background: var(--soft); font-size: 14px; }
.error-notice { background: #fff2ef; color: #962f25; border: 1px solid #f0d7d0; }
.messages { background: var(--pale); }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.loading-bar { padding: 12px; background: var(--pale); color: var(--green); border-radius: 7px; margin-bottom: 18px; }
.htmx-request .lot-grid { opacity: .5; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding-block: 26px; font-size: 12px; }
.footer-inner strong { font-size: 18px; color: var(--ink); text-transform: uppercase; }
.footer-inner p { margin: 0; }
.footer-inner a { font-size: 14px; white-space: nowrap; }
.form-page { max-width: 500px; margin: 30px auto 70px; }
.form-card { border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.form-card h1 { font-size: 30px; }
.form-card form { margin-top: 26px; }
.form-card .button { width: 100%; margin-top: 10px; }
.form-alternative { margin-top: 24px; text-align: center; font-size: 14px; }
.form-alternative a { color: var(--green); text-decoration: underline; }
.back-link { display: block; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.success-symbol { color: var(--green); font-size: 40px; }
.error-page { max-width: 700px; margin: 50px auto; }
.skip-link { position: fixed; z-index: 30; top: -100px; left: 10px; background: white; border: 2px solid var(--green); padding: 10px; }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0,0,0,0); overflow: hidden; padding: 0; border: 0; white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 1500px) {
  .card-price { font-size: 24px; }
}
@media (max-width: 1279px) {
  .shell { padding-inline: 28px; }
  .header-main { gap: 18px; }
  .brand { font-size: 24px; gap: 10px; }
  .brand-mark { width: 30px; height: 25px; padding-inline: 2px; }
  .account-nav { gap: 12px; }
  .favorites-link span { display: none; }
  .category-nav { gap: 42px; }
  .catalog-layout { grid-template-columns: 210px minmax(0,1fr); column-gap: 25px; }
  .lot-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filter-panel { padding-right: 18px; }
  .detail-layout { grid-template-columns: minmax(0,1fr) 305px; gap: 32px; }
}
@media (max-width: 1099px) {
  .catalog-layout { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-template-areas: "heading heading" "filters sort" "source source" "results results"; gap: 18px 14px; }
  .page-heading { margin: 0; }
  .filter-panel { padding: 0; border: 0; }
  .filter-panel > summary { display: flex; align-items: center; justify-content: center; gap: 12px; list-style: none; border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; font-weight: 600; min-height: 49px; }
  .filter-panel > summary .icon:last-child { width: 16px; margin-left: auto; }
  .filter-panel[open] > summary { background: var(--pale); }
  .filter-panel[open] > summary .icon:last-child { transform: rotate(180deg); }
  .filter-panel form { position: absolute; z-index: 12; left: 0; top: auto; width: min(440px,100%); max-height: 65vh; overflow-y: auto; overscroll-behavior: contain; margin-top: 10px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 12px 36px #11151c18; }
  .filter-option { min-height: 44px; }
  .category-option { min-height: 44px; }
  .results-toolbar { display: contents; }
  .sort-control { grid-area: sort; min-width: 0; position: relative; border: 1px solid var(--line); border-radius: 10px; gap: 0; }
  .sort-control > .icon { position: absolute; left: 14px; width: 22px; pointer-events: none; }
  .sort-control select { width: 100%; min-width: 0; height: 47px; padding-left: 45px; background: transparent; border: 0; }
  .sort-submit { margin: 3px; }
  .source-control { grid-area: source; }
  .source-tab { background: var(--soft); border-color: transparent; padding-inline: 22px; }
  .lot-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px 18px; }
  .card-media { aspect-ratio: 1.85; }
  .card-price { font-size: 26px; }
  .lot-card h2 { font-size: 19px; }
  .card-location, .card-meta { font-size: 16px; }
  .favorite-button { width: 44px; height: 44px; }
  .favorite-button .icon { width: 26px; height: 26px; }
  .category-results .breadcrumbs { margin-bottom: 20px; }
}
@media (max-width: 899px) {
  .header-main { flex-wrap: wrap; padding-block: 18px; gap: 18px; }
  .brand { margin-right: auto; }
  .catalog-button { order: 1; }
  .header-search { order: 2; flex-basis: calc(100% - 155px); }
  .region-picker { margin-left: auto; }
  .category-nav { gap: 35px; }
  .detail-layout { grid-template-columns: minmax(0,1fr) 260px; gap: 24px; }
  .detail-price { font-size: 34px; }
  .detail-heading h1 { font-size: 32px; }
  .source-link { font-size: 14px; }
  .detail-save .favorite-button, .report-link { font-size: 14px; }
}
@media (max-width: 600px) {
  .shell { padding-inline: 16px; }
  .site-header { border: 0; }
  .header-main { padding-top: 18px; padding-bottom: 12px; gap: 17px 12px; }
  .brand { font-size: 29px; letter-spacing: -.9px; }
  .brand-mark { display: none; }
  .catalog-button { display: none; }
  .account-nav { gap: 8px; }
  .account-login { min-width: 32px; }
  .account-login .icon { width: 20px; }
  .favorites-link { min-width: 35px; justify-content: center; }
  .favorites-link > .icon { width: 28px; height: 28px; }
  .header-search { order: 2; flex-basis: 100%; height: 48px; background: var(--soft); border-color: #e0e3e9; border-radius: 10px; flex-direction: row-reverse; }
  .header-search input { font-size: 16px; padding-left: 0; }
  .header-search button { width: 45px; }
  .header-search .icon { width: 23px; height: 23px; }
  .region-picker { order: 3; width: 100%; margin: -4px 0 0; font-size: 16px; }
  .region-picker summary { min-height: 32px; gap: 9px; }
  .region-picker summary span { max-width: 85%; }
  .region-picker summary .icon:first-child { width: 20px; height: 23px; }
  .region-picker summary .icon:last-child { margin-left: auto; transform: rotate(-90deg); }
  .region-picker[open] summary .icon:last-child { transform: none; }
  .region-popover { width: 100%; }
  .category-nav { gap: 9px; min-height: 46px; padding-bottom: 0; }
  .category-nav a { border-radius: 30px; background: var(--soft); padding: 11px 20px; font-size: 15px; }
  .category-nav a[aria-current] { background: #e0f2b6; font-weight: 500; }
  .category-nav a[aria-current]::after { display: none; }
  .main-content { padding-top: 23px; padding-bottom: 40px; }
  .demo-notice { margin-bottom: 19px; align-items: flex-start; gap: 8px; font-size: 12px; }
  h1 { font-size: 32px; letter-spacing: -.8px; }
  .page-heading { margin-bottom: 2px; }
  .result-count { font-size: 14px; }
  .catalog-layout { gap: 15px 10px; }
  .filter-panel > summary { gap: 9px; padding: 10px 9px; font-size: 15px; min-height: 48px; }
  .filter-panel > summary .icon { width: 21px; }
  .filter-panel > summary .icon:last-child { display: none; }
  .filter-panel form { padding: 20px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .sort-control select { font-size: 14px; height: 46px; padding-left: 36px; padding-right: 5px; }
  .sort-control > .icon { left: 9px; width: 19px; }
  .source-tabs { gap: 7px; padding: 2px 0; }
  .source-tab { border-radius: 8px; padding: 8px 15px; min-height: 42px; }
  .filter-chips { gap: 8px; margin-bottom: 18px; }
  .filter-chips a { min-height: 35px; font-size: 14px; border-radius: 24px; padding: 6px 12px; background: var(--accent); }
  .filter-chips .clear-chips { padding-inline: 3px; font-size: 12px; }
  .lot-grid { gap: 25px 10px; }
  .card-media { aspect-ratio: 1.45; border-radius: 7px; }
  .card-content { padding-top: 8px; }
  .card-price { font-size: 21px; margin-bottom: 4px; letter-spacing: -.45px; }
  .lot-card h2 { font-size: 16px; line-height: 1.32; margin-bottom: 4px; }
  .card-location, .card-meta { font-size: 14px; line-height: 1.42; }
  .card-status { font-size: 12px; }
  .card-media > .favorite-form { top: 2px; right: 2px; }
  .favorite-button { width: 44px; height: 44px; padding: 10px; background: transparent; }
  .card-media .favorite-button { color: var(--ink); background: #fffffff0; }
  .card-media .favorite-button.selected { color: var(--green); }
  .favorite-button .icon { width: 26px; height: 26px; }
  .card-demo { top: 8px; left: 8px; font-size: 9px; }
  .photo-placeholder { gap: 5px; padding: 16px 8px; font-size: 12px; }
  .photo-placeholder > .icon { width: 30px; height: 30px; margin-top: 10px; }
  .photo-placeholder small { display: none; }
  .breadcrumbs { font-size: 12px; gap: 6px; margin-bottom: 17px; }
  .category-results .breadcrumbs { display: none; }
  .pagination { margin-top: 28px; gap: 5px; }
  .pagination a { min-width: 42px; height: 44px; }
  .detail-heading { margin-bottom: 18px; }
  .detail-heading h1 { font-size: 28px; }
  .detail-layout { display: flex; flex-direction: column; gap: 0; }
  .detail-main { display: contents; }
  .gallery { width: 100%; order: 0; margin-bottom: 23px; }
  .gallery-primary, .detail-placeholder { aspect-ratio: 1.35; border-radius: 8px; }
  .gallery-thumbnails { gap: 8px; margin-top: 9px; }
  .gallery-thumbnails a { flex-basis: calc((100% - 24px) / 4); }
  .gallery-step { width: 38px; height: 44px; }
  .gallery-prev { left: 8px; }
  .gallery-next { right: 8px; }
  .gallery-counter { left: 10px; bottom: 10px; font-size: 12px; }
  .purchase-panel { position: static; order: 1; width: 100%; margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .detail-price { font-size: 36px; }
  .source-actions { margin-top: 20px; }
  .source-link, .detail-save .favorite-button, .report-link { font-size: 16px; }
  .detail-section { width: 100%; order: 2; margin-bottom: 28px; }
  .originals { order: 3; }
  .source-section { order: 4; }
  .detail-section h2 { font-size: 23px; }
  .characteristics > div { font-size: 14px; grid-template-columns: 44% minmax(0,1fr); padding: 10px 0; }
  .characteristic-group-title { font-size: 12px; }
  .auto-badge { font-size: 12px; }
  .original-text { font-size: 16px; }
  .source-dates { flex-direction: column; font-size: 14px; }
  .footer-inner { flex-wrap: wrap; gap: 16px; padding-block: 24px; }
  .footer-inner > p { order: 2; width: 100%; }
  .footer-inner > a { margin-left: auto; }
  .form-page { margin: 15px auto 40px; }
  .form-card { padding: 24px 20px; }
  .form-card h1 { font-size: 27px; }
  .empty-state { padding: 40px 18px; }
}
@media (max-width: 359px) {
  .brand { font-size: 26px; }
  .shell { padding-inline: 12px; }
  .lot-grid { grid-template-columns: 1fr; }
  .card-media { aspect-ratio: 1.6; }
  .sort-control select { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* Broken media retains its slot and can recover when another gallery photo loads. */
.image-error { position: absolute; inset: 0; }
.gallery-thumbnails a { position: relative; aspect-ratio: 1.35; }
.gallery-thumbnails .image-error { min-height: 0; padding: 5px; font-size: 12px; }
.category-option[aria-current] { color: var(--green); font-weight: 600; }
.sort-submit { flex: 0 0 40px; width: 40px; min-width: 40px; padding: 8px; }
.sort-submit .icon { width: 19px; height: 19px; }
@media (max-width: 1099px) {
  .sort-control select { flex: 1; width: 0; }
  .sort-submit { border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; margin: 0; min-height: 46px; }
}
/* Invalid drafts keep the previous results visible and point to the required field. */
[data-client-invalid] { border-color: #b4493d !important; }

/* Source-level photographs are provenance, never an inferred item photo. */
.gallery-title { font-size: 1.1rem; margin: 0 0 12px; }
.source-gallery { margin-bottom: 28px; }
.source-gallery-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; list-style: none; }
.source-gallery-toggle::-webkit-details-marker { display: none; }
.source-gallery-toggle .gallery-title { margin: 0; }
.source-gallery-toggle > .icon { flex-shrink: 0; }
.source-gallery[open] > .source-gallery-toggle { margin-bottom: 12px; }
.source-gallery[open] > .source-gallery-toggle > .icon { transform: rotate(180deg); }
.source-photo-note { margin: 0 0 8px; padding: 12px 16px; border-left: 3px solid var(--accent, #497447); background: #f1f5ef; line-height: 1.5; }

.card-source-photo { position: absolute; bottom: 8px; left: 8px; right: 8px; width: fit-content; max-width: calc(100% - 16px); padding: 5px 8px; border-radius: 4px; background: #ffffffed; color: #344136; font-size: 11px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; pointer-events: none; }
