/* ============================================================
   doshka — hybrid 8-bit theme
   Pixel font for chrome/headings/buttons; readable font for body.
   ============================================================ */

/* ---- Press Start 2P (vendored, Latin + Cyrillic for Ukrainian) ---- */
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-cyrillic-ext-3xhhmN5.woff2") format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-cyrillic-ifM4FPu.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-latin-ext-1hXOF9o.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-latin-fTXzMc-.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Pixelify Sans (vendored): soft, readable pixel font for general use ---- */
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/PixelifySans-400-cyrillic-vYvBR0M.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/PixelifySans-400-latin-CZnHfB7.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/PixelifySans-700-cyrillic-ZAFQdff.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/PixelifySans-700-latin-hQmQgmL.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Soft pastel palette (best-practice: pastel surfaces, accessible text) ---- */
:root {
    --bg:       #f7f5f1;  /* warm off-white */
    --panel:    #ffffff;
    --ink:      #3a3d44;  /* soft charcoal (not harsh black) */
    --muted:    #8a9099;  /* gentle grey */
    --line:     #ece9e2;  /* very soft hairline */
    --primary:  #5b93c9;  /* dusty pastel blue (accents/links) */
    --primary-btn:#3f7cb8;/* slightly deeper for white-text buttons (contrast) */
    --primary-d:#396396;  /* readable text on pastel-blue tints */
    --success:  #56a97b;  /* soft sage green */
    --success-d:#337a53;  /* readable green text (price) */
    --warning:  #e0b45f;  /* soft amber */
    --danger:   #d98a7e;  /* soft coral */
    --tint:     #eaf1f8;  /* pastel blue tint (tags/hover) */
    --tint-g:   #e9f4ee;  /* pastel green tint */
    --radius:   14px;
    --radius-sm:10px;
    --shadow:   0 1px 2px rgba(40,42,60,.04), 0 10px 28px rgba(40,42,60,.05);
    --shadow-sm:0 1px 2px rgba(40,42,60,.05);
    --display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --body:    system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --pixel:   var(--display);
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .pixel, .nav a, .price {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0;
}

/* Clean modern wordmark (was a harsh pixel font) */
.site-title { font-family: var(--display); font-weight: 800; letter-spacing: -.5px; }

a { color: var(--primary); }

/* ---- Header ---- */
.site-header {
    background: var(--ink);
    color: #fff;
    border-bottom: 4px solid var(--warning);
    padding: 18px 20px;
}
.site-header .wrap {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.site-title {
    color: var(--warning);
    font-size: 22px;
    text-decoration: none;
    text-shadow: 3px 3px 0 #000;
}
.site-title .blink { color: var(--success); }
.tagline {
    font-family: var(--body);
    color: #cfd3d7;
    font-size: 13px;
    margin-left: auto;
}
.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--warning); font-size: 15px; text-decoration: none; }
.nav a:hover { color: #fff; }
.nav .nav-user { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--success); }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
/* The browse page (home) uses the full width so filters sit far-left and the
   grid shows as many listings as fit across the centre. */
body.browse-page .container { max-width: 1560px; }

.toolbar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 22px;
}
.toolbar .nes-input { flex: 1; min-width: 200px; }

.section-title {
    font-size: 16px;
    margin: 8px 0 18px;
    color: var(--ink);
}

/* ---- Listing grid ---- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}
.card { background: var(--panel); }
.card .thumb {
    width: 100%; height: 150px; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    background: repeating-linear-gradient(45deg, #dfe6ec, #dfe6ec 10px, #eef2f5 10px, #eef2f5 20px);
    border-bottom: 4px solid var(--ink);
}
.card .body { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.card .title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.25;
    margin: 0 0 8px;
    min-height: 40px;
}
.card .desc { font-size: 14px; color: var(--muted); margin: 0 0 12px; flex: 1; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { color: #2b8a3e; font-size: 15px; line-height: 1.4; }
.loc { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card .posted { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.card .source { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); background: var(--chip-bg, #eef2f7); border-radius: 6px; padding: 1px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; text-decoration: none; }
.card a.source:hover { color: var(--primary-d); text-decoration: underline; }

/* Detail-page source credit */
.detail-source { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.detail-source a { color: var(--primary-d); text-decoration: none; }
.detail-source a:hover { text-decoration: underline; }

/* /channels transparency page */
.channels-head { margin: 8px 0 18px; }
.page-h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; max-width: 60ch; }
.channel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.channel-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.channel-handle { font-weight: 600; text-decoration: none; color: var(--primary-d); }
.channel-handle:hover { text-decoration: underline; }
.channel-city { color: var(--muted); font-size: 13px; }
.channel-count { margin-left: auto; font-size: 12px; color: var(--muted); text-decoration: none; background: var(--chip-bg, #eef2f7); border-radius: 6px; padding: 2px 8px; }
.channel-count:hover { color: var(--primary-d); }
.channels-foot { margin-top: 18px; color: var(--muted); font-size: 14px; }

/* Source multi-select filter (can get long → scroll) */
.fp-checks-scroll { max-height: 190px; overflow-y: auto; padding-right: 4px; }
.fp-src-all { font-weight: 400; font-size: 12px; margin-left: 6px; }
.fp-src-cnt { color: var(--muted); font-size: 11px; }

/* Compact multi-select (native <details> dropdown) for the source-channel filter */
.fp-multi { position: relative; }
.fp-multi-summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 30px 8px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; font-size: 13px; color: var(--ink);
    position: relative;
}
.fp-multi-summary::-webkit-details-marker { display: none; }
.fp-multi-summary::after {
    content: '▾'; position: absolute; right: 12px; color: var(--muted);
    transition: transform .15s;
}
.fp-multi[open] .fp-multi-summary::after { transform: rotate(180deg); }
.fp-multi[open] .fp-multi-summary { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.fp-multi .fp-checks-scroll {
    margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff;
}
.detail-realty { margin: 6px 0 0; font-size: 15px; font-weight: 700; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.detail-stats .stat {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 14px; color: var(--ink);
    background: #fff; border: 2px solid var(--ink);
    padding: 4px 10px;
}
.detail-stats .stat b { font-size: 16px; }

/* ---- Login ---- */
.login-box { max-width: 460px; margin: 40px auto; text-align: center; }
.login-box .title { font-size: 14px; }
.login-hint { font-size: 13px; color: #cfd3d7; }
.login-widget { margin: 22px 0; display: flex; justify-content: center; min-height: 50px; }
.login-back { font-size: 12px; }
.login-back a { color: var(--warning); }

.tag {
    display: inline-block; font-size: 11px; padding: 3px 7px;
    background: var(--warning); color: #000; margin-bottom: 8px;
}
.tag.free { background: var(--success); color: #07350f; }

/* ---- Filter bar ---- */
/* ---- Browse layout: filter sidebar + results ---- */
.browse { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters-panel { position: sticky; top: 16px; }
.fp-form {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 16px 18px;
}
.fp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fp-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.fp-reset { font-size: 12px; color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--line); }
.fp-reset:hover { color: var(--primary-d); border-color: var(--primary); }
.fp-group { margin-bottom: 15px; }
.fp-group:last-of-type { margin-bottom: 18px; }
.fp-label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 7px; }

/* Soft selects */
.fp-select { position: relative; }
.fp-select::after {
    content: ''; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.fp-select select {
    width: 100%; appearance: none; -webkit-appearance: none;
    font: inherit; font-size: 14px; color: var(--ink); background: var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 9px 30px 9px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.fp-select select:hover { border-color: #d7d2c8; }
.fp-select select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }

/* Soft pill toggles (deal / market / rooms) */
.fp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-pill {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px;
    padding: 6px 12px; font-size: 13px; color: var(--ink); background: var(--panel);
    border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.fp-pill:hover { border-color: #d7d2c8; }
.fp-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.fp-pill.is-on { background: var(--tint); border-color: var(--primary); color: var(--primary-d); font-weight: 600; }

/* Price range */
.fp-checks { display: flex; flex-direction: column; gap: 6px; }
.fp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--ink); }
.fp-check input { width: auto; margin: 0; accent-color: var(--primary); }

.fp-price { display: flex; align-items: center; gap: 8px; }
.fp-price input {
    width: 100%; min-width: 0; font: inherit; font-size: 14px; color: var(--ink);
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 9px 10px; transition: border-color .15s, box-shadow .15s;
}
.fp-price input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.fp-dash { color: var(--muted); }

.fp-apply {
    width: 100%; margin-top: 2px; padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 600;
    color: #fff; background: var(--primary-btn); border: none; border-radius: var(--radius-sm);
    cursor: pointer; transition: background .15s, transform .05s;
}
.fp-apply:hover { background: var(--primary-d); }
.fp-apply:active { transform: translateY(1px); }

@media (max-width: 860px) {
    .browse { grid-template-columns: 1fr; gap: 16px; }
    .filters-panel { position: static; }
    .fp-group { margin-bottom: 12px; }

    /* Reclaim vertical space on mobile — the header + breadcrumb used to eat ~1/3
       of the screen before the listing showed. Drop the decorative tagline, tighten
       header padding, shrink the breadcrumb, and start content higher. */
    .site-header { padding: 8px 14px; border-bottom-width: 2px; }
    .site-header .wrap { gap: 8px 12px; }
    .tagline { display: none; }
    .site-title { font-size: 18px; text-shadow: 2px 2px 0 #000; }
    .nav { gap: 12px; font-size: 14px; }
    .nav a { font-size: 14px; }
    .container { margin: 12px auto; }
    .breadcrumb { margin-bottom: 10px; }
    .breadcrumb a, .breadcrumb .sep { font-size: 12px; }
}

/* ---- Category chips ---- */
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cat-chip {
    font-size: 12px; text-decoration: none; color: var(--ink);
    background: #fff; border: 3px solid var(--ink);
    padding: 6px 10px; white-space: nowrap;
}
.cat-chip:hover { background: var(--warning); }
.cat-chip.is-active { background: var(--ink); color: var(--warning); }
.cat-count {
    display: inline-block; margin-left: 4px; padding: 0 5px;
    font-size: 11px; background: var(--ink); color: var(--warning);
    border-radius: 8px; line-height: 1.6;
}
.cat-chip.is-active .cat-count { background: var(--warning); color: var(--ink); }

/* ---- Card link ---- */
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; transition: transform .05s; }
.card-link:hover { transform: translate(-2px, -2px); }
.card-link:active { transform: translate(0, 0); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 40px; }
.empty-state .desc { color: var(--muted); margin: 8px 0 18px; }

/* ---- Pager ---- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 30px 0; }
.pager-info { font-family: var(--display); font-weight: 700; font-size: 14px; }

/* ---- Listing detail ---- */
.breadcrumb { margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--muted); font-size: 13px; }
/* Photo top-left, description bottom-left, sticky price+contact+specs on the right.
   On mobile it stacks cleanly: photo → contact/specs → description. */
.detail {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    grid-template-areas: "media aside" "desc aside";
    gap: 20px;
    align-items: start;
}
.detail-media { grid-area: media; background: #fff; min-width: 0; }
.detail-aside { grid-area: aside; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; min-width: 0; }
.detail-descblock { grid-area: desc; min-width: 0; }
@media (max-width: 880px) {
    .detail { grid-template-columns: 1fr; grid-template-areas: "media" "aside" "desc"; gap: 16px; }
    .detail-aside { position: static; }
    .gallery-main { height: 260px; }
}
.detail-descblock .detail-desc { margin: 0; }
/* Specs in the narrow aside: single column of rows */
.specs-narrow { grid-template-columns: 1fr; gap: 8px; }
/* Never let content overflow its column on small screens */
.detail-desc, .info-block, .specs dd { overflow-wrap: anywhere; }
.detail-thumb {
    height: 360px; display: flex; align-items: center; justify-content: center;
    font-size: 120px; background: #f5f3ee;
}
.detail-info { display: flex; flex-direction: column; gap: 16px; }
.info-block { background: #fff; border: 3px solid var(--ink); padding: 16px 18px; }
.info-block-title { font-family: var(--display); font-size: 13px; margin: 0 0 12px; }
.detail-title { font-family: var(--display); font-size: 18px; line-height: 1.3; margin: 0 0 6px; }
.detail-price { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--success-d); margin: 6px 0 16px; }
/* Characteristics: label/value rows */
.specs { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; }
.specs .spec { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #d8d4cc; padding-bottom: 6px; }
.specs dt { color: var(--muted); font-size: 14px; }
.specs dd { margin: 0; font-weight: 700; font-size: 14px; text-align: right; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-desc { font-size: 15px; line-height: 1.7; }
.detail-seller { margin: 18px 0; }
.detail-chat { margin-top: 6px; }
.detail-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---- Photos: card thumbnail ---- */
.card .thumb { overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #e7ecf0; }

/* Video preview loading bar: while a hovered clip buffers, an indeterminate
   stripe runs across the top of the poster; removed once it can play. */
.card .thumb.is-loading::before {
    content: ''; position: absolute; top: 0; left: 0; z-index: 3;
    height: 3px; width: 35%;
    background: var(--primary, #4a90d9);
    animation: thumb-load 1.1s ease-in-out infinite;
}
@keyframes thumb-load {
    0% { left: -35%; } 100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .card .thumb.is-loading::before { animation: none; width: 100%; opacity: .5; }
}

/* Subtle image "comes alive" zoom on hover (the .thumb clips the overflow). */
.card .thumb img, .card .thumb-video { transition: transform .6s cubic-bezier(.2, .6, .2, 1); }
.card-link:hover .thumb img, .card-link:hover .thumb-video { transform: scale(1.07); }
@media (prefers-reduced-motion: reduce) {
    .card .thumb img, .card .thumb-video { transition: none; }
    .card-link:hover .thumb img, .card-link:hover .thumb-video { transform: none; }
}

/* ---- "Fresh arrivals" auto-scrolling strip (home only) ---- */
.ticker {
    overflow-x: auto; overflow-y: hidden; margin: 2px 0 22px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker::-webkit-scrollbar { height: 0; }
.ticker-track { display: flex; gap: 14px; width: max-content; }
.ticker-item {
    flex: none; width: 200px; text-decoration: none; color: inherit;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ticker-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ticker-thumb { display: block; width: 100%; height: 120px; overflow: hidden; background: #f2f0ec; }
.ticker-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .6, .2, 1); }
.ticker-item:hover .ticker-thumb img { transform: scale(1.07); }
.ticker-cap { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticker-price { font-weight: 700; color: var(--success-d); font-size: 14px; }
.ticker-title { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes ticker-drift { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (max-width: 720px) { .ticker-item { width: 150px; } .ticker-thumb { height: 96px; } }
@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
    .ticker { -webkit-mask-image: none; mask-image: none; }
    .ticker-thumb img { transition: none; }
    .ticker-item:hover .ticker-thumb img { transform: none; }
}
.detail-video { width: 100%; max-height: 460px; border-radius: var(--radius-sm); background: #000; display: block; margin-bottom: 12px; }
.card .thumb-badge {
    position: absolute; left: 8px; bottom: 8px; z-index: 1;
    font-size: 11px; font-weight: 600; color: #fff;
    background: rgba(40, 42, 60, .62); border-radius: 999px; padding: 2px 9px;
    backdrop-filter: blur(2px); pointer-events: none;
}

/* ---- Photos: detail gallery ---- */
.gallery-main {
    width: 100%; height: 400px; object-fit: contain;
    background: #f5f3ee;
    display: block;
}
@media (max-width: 720px) { .gallery-main { height: 300px; } }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.gallery-thumb {
    width: 64px; height: 64px; padding: 0; cursor: pointer;
    border: 3px solid var(--ink); background: #fff; overflow: hidden;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.is-active { border-color: var(--warning); }

/* ---- Photos: edit form ---- */
.field-help { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.edit-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.edit-image {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    border: 3px solid var(--ink); background: #fff; padding: 6px; font-size: 12px;
}
.edit-image img { width: 90px; height: 90px; object-fit: cover; display: block; }
.edit-image-rm { display: flex; align-items: center; gap: 4px; }

/* ---- Favorites ---- */
.card-wrap { position: relative; height: 100%; }
.fav-form { position: absolute; top: 8px; right: 8px; margin: 0; z-index: 2; }
.fav-btn {
    width: 38px; height: 38px; line-height: 1; font-size: 20px; cursor: pointer;
    background: rgba(255, 255, 255, .9); border: 3px solid var(--ink); color: #b08900;
    padding: 0; display: flex; align-items: center; justify-content: center;
}
.fav-btn:hover { background: #fff; }
.fav-btn.is-fav { background: var(--warning); color: #000; }
.fav-form-inline { display: inline; margin: 0; }
.fav-detail.is-fav { background: var(--warning); }

.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: center; }
.detail-phone { font-size: 16px; margin: 10px 0 0; }
.detail-phone a { color: #2b8a3e; font-weight: 700; text-decoration: none; }

/* ---- Image lightbox ---- */
.gallery-main { cursor: zoom-in; }
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0, 0, 0, .85);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 95vw; max-height: 90vh; object-fit: contain; cursor: zoom-out; }
.lightbox-close {
    position: absolute; top: 14px; right: 18px;
    font-size: 34px; line-height: 1; color: #fff; background: none; border: none; cursor: pointer;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 54px; height: 72px; font-size: 44px; line-height: 1;
    color: #fff; background: rgba(0, 0, 0, .35); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; user-select: none;
}
.lightbox-nav:hover { background: rgba(0, 0, 0, .6); }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-count {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 14px; background: rgba(0, 0, 0, .45); padding: 3px 12px; border-radius: 12px;
}

/* ---- Real-estate form group ---- */
.realty-fields { border: 3px dashed var(--ink); padding: 12px 14px; margin: 4px 0 14px; }
.realty-fields legend { font-size: 13px; font-weight: 700; padding: 0 6px; }

/* ---- Listing status / expiry / owner tools ---- */
.detail-status { display: inline-block; background: #e03131; color: #fff; padding: 3px 8px; font-size: 12px; margin: 0 0 8px; }
.detail-expiry { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.owner-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.owner-tools form { margin: 0; }

/* ---- Notifications box ---- */
.notify-box { margin-bottom: 22px; }
.notify-state { margin: 0 0 10px; font-size: 14px; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notify-actions form { margin: 0; }

/* ---- Forms ---- */
.form-box { max-width: 640px; margin: 10px auto 40px; }
.form-box .title { font-size: 14px; }
.form-box label { display: block; font-family: var(--display); font-weight: 700; font-size: 14px; margin: 16px 0 6px; }
.form-field { margin-bottom: 4px; }
.nes-textarea { width: 100%; font-family: var(--body); }
.form-box .nes-btn { margin-top: 20px; }
ul { list-style: none; padding-left: 0; }
.form-error-icon, .form-box ul li { color: var(--danger); font-size: 12px; }

/* ---- Flash ---- */
.flash {
    max-width: 1100px; margin: 16px auto 0; padding: 12px 16px;
    font-family: var(--display); font-weight: 700; font-size: 15px; border: 4px solid var(--ink);
}
.flash-success { background: var(--success); color: #07350f; }

/* ---- Footer ---- */
.site-footer {
    text-align: center; color: var(--muted);
    font-size: 12px; padding: 30px 20px 50px;
}
.site-footer .pixel { font-size: 14px; }

/* ---- Cursor: kill nes.css's pixel hand-cursor entirely (needs !important) ---- */
html, body, *, *::before, *::after { cursor: auto !important; }
a, button, summary, label[for], [role="button"], select,
.nes-select, .nes-select select, .nes-btn, .cat-chip, .card-link,
input[type="submit"], input[type="button"], input[type="reset"] {
    cursor: pointer !important;
}
input[type="text"], input[type="number"], input[type="search"],
input[type="email"], input[type="tel"], textarea, .nes-input, .nes-textarea {
    cursor: text !important;
}
:disabled, .is-disabled { cursor: not-allowed !important; }

/* ---- Email login ---- */
.login-or {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted); font-size: 12px; margin: 18px 0;
}
.login-or::before, .login-or::after {
    content: ""; flex: 1; height: 2px; background: #44494e;
}
.login-email-btn { width: 100%; }
.login-email-form { margin: 16px 0; text-align: left; }
.login-email-form .nes-field { margin-bottom: 16px; }
.login-email-form label {
    display: block; font-family: var(--display); font-weight: 700;
    font-size: 13px; margin-bottom: 6px;
}
.login-email-form .nes-btn { width: 100%; }

/* ============================================================
   MODERN THEME — soft, readable overrides (retire 8-bit look)
   Loaded after nes.min.css, so these win.
   ============================================================ */

img { image-rendering: auto; }

/* Containers → clean soft cards */
.nes-container, .nes-dialog {
    border: 1px solid var(--line);
    border-image: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--panel);
    padding: 18px 20px;
}
.nes-container.is-rounded { border-radius: var(--radius); }
.nes-container::after, .nes-container::before,
.nes-container.is-rounded::after { content: none !important; }

/* Buttons → modern */
.nes-btn, input[type="submit"], input[type="button"] {
    border: 1px solid var(--line);
    border-image: none;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    background: #fff;
    color: var(--ink);
    font-family: var(--display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0;
    padding: 9px 16px;
    text-shadow: none;
    transition: filter .12s, transform .05s, box-shadow .12s;
}
.nes-btn::after { content: none !important; }
.nes-btn:hover { filter: brightness(.97); }
.nes-btn:active { transform: translateY(1px); }
.nes-btn.is-primary { background: var(--primary-btn); border-color: var(--primary-btn); color: #fff; }
.nes-btn.is-success { background: var(--success-d); border-color: var(--success-d); color: #fff; text-shadow: none; }
.nes-btn.is-warning { background: var(--warning); border-color: var(--warning); color: #3a2c00; }
.nes-btn.is-error, .nes-btn.is-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.nes-btn.is-disabled { background: #f0eee9; color: var(--muted); border-color: var(--line); box-shadow: none; }

/* Inputs / selects → soft */
.nes-input, .nes-textarea, .nes-select select {
    border: 1px solid var(--line);
    border-image: none;
    border-radius: 10px;
    box-shadow: none;
    background: #fff;
    padding: 10px 12px;
    font-family: var(--body);
}
.nes-input:focus, .nes-textarea:focus, .nes-select select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint);
}

/* Header → soft light bar */
.site-header {
    background: #fff; color: var(--ink);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.site-title { color: var(--ink); text-shadow: none; font-weight: 800; }
.site-title .blink { color: var(--primary); }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav .nav-user { color: var(--primary); }

/* RU / UA language switch */
.lang-switch { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch a { font-family: var(--display); font-weight: 700; font-size: 12px; line-height: 1; padding: 4px 9px; border-radius: 999px; color: var(--muted); }
.lang-switch a:hover { color: var(--ink); background: var(--tint); }
.lang-switch a.is-active { background: var(--primary); color: #fff; }
.tagline { color: var(--muted); }
.blink { color: var(--primary); }

/* Tags → soft pills */
.tag {
    background: var(--tint); color: var(--primary-d);
    border: none; border-radius: 999px;
    font-weight: 600; font-size: 12px; padding: 4px 11px;
    font-family: var(--display); letter-spacing: 0;
}
.tag.free { background: #e7f6ec; color: #1c7a44; }

/* Cards → soft, hover lift */
.card, .card-wrap { border-radius: var(--radius); }
.card {
    border: 1px solid var(--line); border-image: none;
    border-radius: var(--radius); box-shadow: var(--shadow); background: #fff;
    overflow: hidden; padding: 0;
}
.card::after { content: none !important; }
.card-link:hover { transform: translateY(-3px); }
.card-link:active { transform: translateY(-1px); }
.card .thumb { border-bottom: 1px solid var(--line); background: #f2f0ec; }
.card .title { font-size: 15px; }
.price, .card .price, .detail-price { color: var(--success-d); }
.card .posted, .loc { color: var(--muted); }

/* Category chips → soft */
.cat-chip {
    border: 1px solid var(--line); border-radius: 999px;
    background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
    font-family: var(--display); font-weight: 600; font-size: 13px; padding: 7px 14px;
}
.cat-chip:hover { background: var(--tint); border-color: var(--primary); }
.cat-chip.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-count { background: var(--tint); color: var(--primary-d); border-radius: 999px; }
.cat-chip.is-active .cat-count { background: rgba(255,255,255,.25); color: #fff; }

/* Detail blocks / media → soft cards (no heavy double lines) */
.info-block { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.info-block-title { font-family: var(--display); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.detail-media { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; background: #fff; }
.detail-title { font-size: 20px; }
.gallery-thumb { border: 2px solid var(--line); border-radius: 8px; }
.gallery-thumb.is-active { border-color: var(--primary); }
.detail-stats .stat { border: 1px solid var(--line); border-radius: 999px; }

/* ---- Hard overrides: kill remaining 8-bit pixel borders & select arrow ---- */
.nes-container, .nes-container.is-rounded, .nes-dialog,
.card, a.card, .nes-btn, input[type="submit"], input[type="button"],
.nes-input, .nes-textarea, .nes-select select {
    border-image: none !important;
}
.nes-container, .nes-container.is-rounded, .nes-dialog, .card, a.card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow);
}
.nes-btn, input[type="submit"], input[type="button"] { border: 1px solid var(--line) !important; border-radius: 10px !important; }
.nes-input, .nes-textarea, .nes-select select { border: 1px solid var(--line) !important; border-radius: 10px !important; }
.card .thumb { border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; }

/* Soft chevron instead of the pixel triangle on selects */
.nes-select::after { display: none !important; }
.nes-select select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a9099' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 38px;
}

/* ---- Listing form: phone country picker, file button, realty fieldset ---- */
.phone-row { display: flex; gap: 8px; }
.phone-row .nes-input { flex: 1; min-width: 0; }
.phone-cc {
    max-width: 120px; border: 1px solid var(--line) !important; border-radius: 10px !important;
    padding: 10px 8px; background: #fff; font-size: 14px;
}
.file-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-btn {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14px;
}
.file-btn:hover { background: var(--tint); border-color: var(--primary); }
.file-names { color: var(--muted); font-size: 14px; }
.file-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Softer real-estate fieldset (was a harsh dashed box) */
.realty-fields {
    border: 1px solid var(--line) !important; border-radius: var(--radius);
    padding: 14px 16px; margin: 6px 0 16px; background: #fbfbf9;
}
.realty-fields legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 6px; }

/* Config-driven per-category attribute fields */
.attr-group { border: none; padding: 0; margin: 0 0 6px; }
.attr-group legend {
    font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
    letter-spacing: .04em; padding: 10px 0 4px; width: 100%; border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}
.input-with-unit { display: flex; align-items: center; gap: 8px; }
.input-with-unit .nes-input { flex: 1 1 auto; }
.input-with-unit .unit { color: var(--muted); font-size: 13px; white-space: nowrap; }
.attr-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.attr-check input { width: auto; margin: 0; }
.attr-multi-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.attr-multi { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.attr-multi label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.attr-multi input { width: auto; margin: 0; }

/* Error flash */
.flash-error { background: #fdecea; color: #a23b2d; border: 1px solid #f3c6bf; padding: 12px 16px; margin: 0 0 16px; border-radius: var(--radius-sm); }

/* ---- Modal (sold / withdraw) ---- */
.modal {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(30, 32, 48, .45);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 24px; max-width: 420px; width: 100%;
}
.modal-title { margin: 0 0 6px; font-size: 18px; }
.modal-text { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }
.modal-actions .nes-btn { width: 100%; text-align: center; }
.modal-cancel { display: block; width: 100%; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 6px; }
.modal-cancel:hover { color: var(--ink); }

/* ---- Admin dashboard ---- */
.admin-h1 { font-size: 22px; margin: 4px 0 20px; color: var(--ink); }
.admin-h2 { font-size: 15px; margin: 0 0 12px; color: var(--ink); }
.admin-muted { color: var(--muted); font-size: 13px; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.admin-tile {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.at-label { font-size: 12px; color: var(--muted); }
.at-value { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.at-unit { font-size: 14px; font-weight: 600; color: var(--muted); }
.at-sub { font-size: 12px; color: var(--muted); }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 22px; }
.admin-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 22px;
}
.admin-bar-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin-bar-row:last-child { border-bottom: none; }
.admin-bar-row b { color: var(--primary-d); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-card code { background: var(--tint); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ---- Home "subscribe to the feed" bar ---- */
.notify-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 0 0 16px; padding: 10px 16px; border-radius: var(--radius);
    background: var(--tint); border: 1px solid var(--primary);
}
.notify-bar.is-on { background: #e7f6ec; border-color: #57b06f; }
.notify-bar-text { font-weight: 600; font-size: 14px; color: var(--ink); }
.notify-bar-btn {
    border: 1px solid var(--line); border-radius: 999px; padding: 6px 18px;
    font-family: var(--display); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none;
}
.notify-bar-btn.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.notify-bar-btn.is-off { background: #fff; color: var(--muted); }
.notify-bar-btn.is-off:hover { color: var(--ink); }
