      :root {
        --green: #1d7a3a;
        --green-dark: #145c2b;
        --green-deep: #0c3a1d;
        --navy: #16345e;
        --navy-dark: #102747;
        --green-tint: #e7f4ea;
        --wa: #1faa55;
        --ink: #1c2420;
        --ink-soft: #4c5a52;
        --ink-faint: #75847b;
        --line: #dce4de;
        --bg: #f4f6f4;
        --surface: #ffffff;
        --surface-2: #eef2ee;
        --amber: #b97a08;
        --amber-bg: #fdf3dd;
        --blue: #1c5fa8;
        --blue-bg: #e6f0fa;
        --red: #b3261e;
        --red-bg: #fbe9e7;
        --heart: #d92c4a;
        --shadow: 0 1px 3px rgba(16, 42, 24, 0.10), 0 6px 18px rgba(16, 42, 24, 0.06);
        --shadow-lg: 0 12px 40px rgba(10, 30, 16, 0.28);
        --radius: 14px;
      }
      @media (prefers-color-scheme: dark) {
        :root {
          --green: #3fae62;
          --green-dark: #2f8c4c;
          --green-deep: #0a2e16;
          --green-tint: #173324;
          --ink: #e8efe9;
          --ink-soft: #b3c2b8;
          --ink-faint: #84958a;
          --line: #2c3a30;
          --bg: #10160f;
          --surface: #1a221b;
          --surface-2: #232d24;
          --amber: #e8b34b;
          --amber-bg: #3a2f14;
          --blue: #7db4ea;
          --blue-bg: #1d2f45;
          --red: #f2a49e;
          --red-bg: #40201d;
          --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 6px 18px rgba(0,0,0,0.3);
          --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
        }
      }
      * { box-sizing: border-box; }
      /* The hidden attribute must always win: component rules below set
         display on buttons, badges and the views, which would otherwise
         override hidden and leak gated UI (nav buttons, the post form)
         to logged-out visitors. */
      [hidden] { display: none !important; }
      html { scroll-behavior: smooth; }
      body {
        margin: 0;
        font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
        background: var(--bg);
        color: var(--ink);
        font-size: 16px;
        line-height: 1.45;
        -webkit-font-smoothing: antialiased;
      }
      button, [role="button"], select, summary, input:not([type="checkbox"], [type="radio"]), textarea { min-height: 2.25rem; }
      button { font: inherit; cursor: pointer; }
      input, select, textarea { font: inherit; color: inherit; }
      img { display: block; max-width: 100%; }
      .wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

      /* ---------- Header ---------- */
      header.site {
        position: sticky; top: 0; z-index: 40;
        background: #ffffff;
        color: var(--ink);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 1px 6px rgba(16, 42, 24, 0.06);
      }
      .header-in {
        display: flex; align-items: center; gap: 12px;
        padding-top: 10px; padding-bottom: 10px;
      }
      .brand { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
      .brand-mark {
        height: 42px; flex: none;
        display: flex; align-items: center;
      }
      .brand-mark img { height: 100%; width: auto; display: block; }
      .brand-tagline {
        font-size: 0.7rem; font-weight: 700; color: var(--navy);
        letter-spacing: 0.14em; line-height: 1.1; white-space: nowrap; text-align: center;
      }
      .brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; line-height: 1.1; white-space: nowrap; }
      .brand-sub { font-size: 0.72rem; font-weight: 600; opacity: 0.82; letter-spacing: 0.04em; text-transform: uppercase; }
      .demo-tag {
        background: #f5b921; color: #3a2a00;
        font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
        padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
        flex: none;
      }
      .header-spacer { flex: 1; }
      .post-btn {
        background: var(--navy); color: #fff; border: 0;
        font-weight: 800; font-size: 0.92rem;
        padding: 9px 16px; border-radius: 9px;
        display: inline-flex; align-items: center; gap: 7px;
        white-space: nowrap;
      }
      .post-btn:hover { background: var(--navy-dark); }
      .post-btn .free { background: var(--green); color: #fff; font-size: 0.66rem; padding: 2px 6px; border-radius: 5px; letter-spacing: 0.05em; }
      .auth-area { display: flex; align-items: center; gap: 8px; flex: none; }
      .login-btn {
        background: var(--green); color: #fff; border: 1.5px solid var(--green);
        font-weight: 700; font-size: 0.9rem; padding: 8px 14px; border-radius: 9px; white-space: nowrap;
      }
      .login-btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
      .signup-btn {
        background: #fff; color: var(--green-dark); border: 1.5px solid var(--green);
        font-weight: 800; font-size: 0.9rem; padding: 9px 14px; border-radius: 9px; white-space: nowrap;
      }
      .signup-btn:hover { background: var(--green-tint); }
      .user-chip {
        display: inline-flex; align-items: center; gap: 8px;
        background: var(--green-tint); border: 1.5px solid var(--line); color: var(--ink);
        border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 0.88rem; font-weight: 700;
        max-width: 240px;
      }
      .user-chip .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .user-chip .role { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; background: #f5b921; color: #3a2a00; padding: 2px 7px; border-radius: 999px; flex: none; }
      .logout-btn {
        background: var(--navy); color: #fff; border: 0; border-radius: 999px;
        font-size: 0.8rem; font-weight: 800; padding: 5px 11px; min-height: 0; flex: none;
      }
      .logout-btn:hover { background: var(--navy-dark); }
      @media (max-width: 720px) {
        .header-in { flex-wrap: wrap; row-gap: 8px; }
        .brand { order: 1; }
        .demo-tag { order: 2; }
        .auth-area { order: 3; margin-left: auto; }
        .header-spacer { display: none; }
        .post-btn { order: 4; width: 100%; justify-content: center; }
        .brand-name { font-size: 1.08rem; }
        .brand-sub { display: none; }
        .brand-mark { height: 36px; }
        .brand-tagline { font-size: 0.6rem; letter-spacing: 0.11em; }
        .user-chip { max-width: 190px; }
      }

      /* ---------- Main nav ---------- */
      .mainnav {
        background: var(--surface); border-bottom: 1px solid var(--line);
        position: sticky; top: 0; z-index: 35;
      }
      header.site { position: static; }
      .mainnav .wrap { display: flex; gap: 4px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; overflow-x: visible; }
      @media (max-width: 560px) {
        .mainnav button { flex: 1 1 40%; justify-content: center; padding: 8px 8px; font-size: 0.9rem; }
      }
      .mainnav button {
        border: 0; background: transparent; color: var(--ink-soft);
        font-weight: 700; font-size: 0.93rem; padding: 8px 13px; border-radius: 9px;
        display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; min-height: 2.5rem;
      }
      .mainnav button:hover { background: var(--surface-2); }
      .mainnav button[aria-pressed="true"] { background: var(--green-tint); color: var(--green-dark); }
      @media (prefers-color-scheme: dark) { .mainnav button[aria-pressed="true"] { color: var(--green); } }
      .mainnav .nav-count {
        background: var(--heart); color: #fff; font-size: 0.7rem; font-weight: 800;
        min-width: 19px; height: 19px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px;
      }
      .mainnav .nav-count.amber { background: var(--amber); color: #fff; }

      .demo-note {
        background: var(--amber-bg); color: var(--ink);
        border-bottom: 1px solid var(--line);
        font-size: 0.85rem;
      }
      .demo-note .wrap { padding-top: 8px; padding-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; }
      .demo-note svg { flex: none; margin-top: 2px; color: var(--amber); }
      .demo-note b { font-weight: 800; }

      /* ---------- Hero / search ---------- */
      .hero {
        background: var(--green-deep);
        background-image:
          linear-gradient(180deg, rgba(8, 38, 18, 0.32) 0%, rgba(8, 38, 18, 0.42) 55%, rgba(8, 38, 18, 0.58) 100%),
          url("karachi-hero.jpg");
        background-size: cover;
        background-position: center 42%;
        background-repeat: no-repeat;
        color: #fff;
        padding: 30px 0 28px;
      }
      .hero h1 { margin: 0 auto 8px; text-align: center; font-family: "Plus Jakarta Sans", "Manrope", sans-serif; font-size: clamp(2rem, 5.5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; text-shadow: 0 2px 14px rgba(0,0,0,0.55); }
      .hero p.lede { margin: 0 auto 18px; text-align: center; color: rgba(255,255,255,0.94); font-size: 1.05rem; font-weight: 500; letter-spacing: 0.01em; max-width: 520px; text-shadow: 0 1px 10px rgba(0,0,0,0.6); }

      /* ---------- Server-rendered listing page (SEO / no-JS fallback) ----------
         #seo-listing is the listing's real content in the HTML, so search
         engines and visitors without JavaScript see it. On a listing URL
         it is also the visible page content (see the listing-page rules
         below); the detail overlay is NOT auto-opened any more. */
      .seo-listing { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 18px 0 8px; box-shadow: var(--shadow); }
      .seo-listing .seo-back { margin: 0 0 12px; font-size: 0.9rem; }
      .seo-listing h2 { margin: 4px 0 6px; font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.01em; }
      .seo-listing .price { font-size: 1.55rem; }
      .seo-listing h3 { font-size: 1.02rem; margin: 18px 0 6px; }
      .seo-listing .desc { color: var(--ink-soft); margin: 0; white-space: pre-line; }
      .seo-listing .facts { margin-top: 12px; }
      .seo-listing .lister-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
      .seo-listing .lister-box .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
      .seo-listing .lister-box .note { color: var(--ink-soft); font-size: 0.9rem; margin: 8px 0 12px; }

      /* ---------- Dedicated listing page ----------
         On /listing/<id>-<slug> the server-rendered #seo-listing block IS
         the page: the browse chrome (hero, results, post form) is hidden
         and the listing shows as its own page with header + footer, like
         Zameen/OLX. The homepage is unchanged (no listing-page class on
         <body> there), and card clicks on the homepage still open the
         popup overlay. */
      body.listing-page #view-browse .hero,
      body.listing-page #view-browse .results-head,
      body.listing-page #view-browse #grid,
      body.listing-page #view-browse #emptyState,
      body.listing-page #view-browse #mapWrap,
      body.listing-page #view-browse .post-section { display: none; }
      body.listing-page .seo-listing { max-width: 860px; margin: 22px auto 26px; }
      .seo-listing .seo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
      .seo-listing .seo-top .seo-back { margin: 0; }
      .seo-listing .gallery-main { border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
      .seo-listing .thumbs { padding: 0; margin-bottom: 12px; }
      .seo-listing .video-wrap { margin: 14px 0 0; }
      .search-card {
        background: var(--surface); color: var(--ink);
        border-radius: 12px; box-shadow: var(--shadow-lg);
        padding: 10px 12px 12px;
        max-width: 880px; margin: 0 auto;
      }
      .purpose-tabs { display: flex; gap: 7px; margin-bottom: 9px; }
      .purpose-tabs button {
        flex: 1; border: 1.5px solid var(--line); background: var(--surface);
        color: var(--ink-soft); font-weight: 700; font-size: 0.9rem;
        border-radius: 8px; padding: 7px 6px; min-height: 2.1rem;
      }
      .purpose-tabs button[aria-pressed="true"] {
        background: var(--green); border-color: var(--green); color: #fff;
      }
      .search-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
      .field label { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
      .field input, .field select, .field textarea {
        width: 100%; border: 1.5px solid var(--line); border-radius: 8px;
        background: var(--surface); padding: 8px 10px; font-size: 0.94rem;
      }
      .field input:focus, .field select:focus, .field textarea:focus {
        outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green);
      }
      .search-go {
        background: var(--green); color: #fff; border: 0; border-radius: 8px;
        font-weight: 800; font-size: 0.95rem; padding: 9px 16px;
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        width: 100%;
      }
      .search-go:hover { background: var(--green-dark); }
      @media (min-width: 760px) {
        .search-grid { grid-template-columns: repeat(4, 1fr); align-items: end; }
        .search-grid .search-field-wide { grid-column: span 2; }
        .search-go { width: 100%; grid-column: 1 / -1; }
        .purpose-tabs button { flex: 0 0 112px; }
      }

      .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 880px; margin-left: auto; margin-right: auto; justify-content: center; }
      .chips .chips-label { width: 100%; text-align: center; font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,0.85); letter-spacing: 0.04em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
      .chip {
        border: 1.5px solid rgba(255,255,255,0.45); background: rgba(8, 32, 16, 0.42);
        color: #fff; border-radius: 999px; padding: 6px 13px;
        font-size: 0.86rem; font-weight: 600;
      }
      .chip:hover { background: rgba(8, 32, 16, 0.62); }
      .chip[aria-pressed="true"] { background: #fff; color: var(--green-deep); border-color: #fff; font-weight: 800; }

      /* ---------- Results ---------- */
      .results-head {
        display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
        margin: 22px 0 14px;
      }
      .results-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
      .results-head .count { color: var(--ink-soft); font-size: 0.92rem; font-weight: 600; }
      .results-head .spacer { flex: 1; }
      .sort-field { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
      .sort-field select { border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); padding: 6px 9px; font-weight: 600; }
      .lister-filter { display: flex; gap: 6px; }
      .lister-filter button {
        border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft);
        border-radius: 999px; padding: 6px 13px; font-size: 0.86rem; font-weight: 700;
      }
      .lister-filter button[aria-pressed="true"] { background: var(--green-tint); border-color: var(--green); color: var(--green-dark); }
      @media (prefers-color-scheme: dark) {
        .lister-filter button[aria-pressed="true"] { color: var(--green); }
      }
      .view-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
      .view-toggle button {
        border: 0; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 0.88rem;
        padding: 7px 14px; display: inline-flex; align-items: center; gap: 6px;
      }
      .view-toggle button[aria-pressed="true"] { background: var(--green); color: #fff; }

      .grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding-bottom: 8px; }
      @media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
      @media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }

      .card {
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        overflow: hidden; box-shadow: var(--shadow);
        display: flex; flex-direction: column;
      }
      .card.just-added { outline: 3px solid var(--green); outline-offset: -1px; }
      .card-photo { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); }
      .photo-open { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
      .photo-open img { width: 100%; height: 100%; object-fit: cover; }
      .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
      .badge {
        font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
        padding: 4px 8px; border-radius: 6px;
      }
      .badge.sample { background: #f5b921; color: #3a2a00; }
      .badge.new { background: var(--green); color: #fff; }
      .badge.pending { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
      .badge.rejected { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
      .badge.purpose { background: rgba(10, 25, 14, 0.78); color: #fff; position: absolute; bottom: 10px; left: 10px; top: auto; }
      .badge.video { background: #c81e1e; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
      .badge.cat-commercial { background: var(--navy); color: #fff; }
      .badge.cat-residential { background: rgba(255,255,255,0.92); color: var(--green-dark); }
      .fav-btn {
        position: absolute; top: 8px; right: 8px; z-index: 3;
        width: 38px; height: 38px; min-height: 0; border-radius: 999px;
        border: 1px solid var(--line); background: var(--surface); color: var(--ink-faint);
        display: grid; place-items: center; box-shadow: var(--shadow); padding: 0;
      }
      .fav-btn svg { fill: none; stroke: currentColor; }
      .fav-btn[aria-pressed="true"] { color: var(--heart); border-color: var(--heart); }
      .fav-btn[aria-pressed="true"] svg { fill: var(--heart); stroke: var(--heart); }
      .card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
      .price { font-size: 1.28rem; font-weight: 800; color: var(--green-dark); letter-spacing: -0.01em; }
      @media (prefers-color-scheme: dark) { .price { color: var(--green); } }
      .price .per { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
      .card-title {
        font-size: 1.0rem; font-weight: 700; line-height: 1.3; margin: 0;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
      }
      .card-title button { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; min-height: 0; }
      .card-title button:hover { color: var(--green-dark); text-decoration: underline; }
      .loc { display: flex; align-items: center; gap: 5px; color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; }
      .loc svg { flex: none; color: var(--green); }
      .specs { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; margin-top: 2px; }
      .specs span { display: inline-flex; align-items: center; gap: 5px; }
      .specs svg { color: var(--ink-faint); }
      .card-foot { margin-top: auto; padding-top: 10px; }
      .lister-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
      .lister-badge {
        font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
        padding: 3px 8px; border-radius: 999px; flex: none;
      }
      .lister-badge.owner { background: var(--blue-bg); color: var(--blue); }
      .lister-badge.dealer { background: var(--green-tint); color: var(--green-dark); }
      @media (prefers-color-scheme: dark) { .lister-badge.dealer { color: var(--green); } }
      .lister-name { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .verified {
        display: inline-flex; align-items: center; gap: 4px; flex: none;
        font-size: 0.74rem; font-weight: 800; color: var(--green-dark);
      }
      @media (prefers-color-scheme: dark) { .verified { color: var(--green); } }
      .pending-note {
        display: inline-flex; align-items: center; gap: 4px; flex: none;
        font-size: 0.74rem; font-weight: 800; color: var(--amber);
      }
      .contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
      .btn-call, .btn-wa {
        display: inline-flex; align-items: center; justify-content: center; gap: 7px;
        border-radius: 9px; font-weight: 800; font-size: 0.92rem; padding: 10px 8px;
        text-decoration: none; border: 0; min-height: 2.75rem;
      }
      .btn-call { background: var(--green); color: #fff; }
      .btn-call:hover { background: var(--green-dark); }
      .btn-wa { background: var(--wa); color: #fff; }
      .btn-wa:hover { filter: brightness(0.93); }

      .empty {
        background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius);
        padding: 34px 20px; text-align: center; color: var(--ink-soft);
      }
      .empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.05rem; }
      .empty button { margin-top: 10px; background: var(--green); color: #fff; border: 0; border-radius: 9px; padding: 9px 16px; font-weight: 700; }

      /* ---------- Map view ---------- */
      .map-layout { display: grid; grid-template-columns: 1fr; gap: 14px; padding-bottom: 8px; }
      @media (min-width: 900px) { .map-layout { grid-template-columns: 1.65fr 1fr; align-items: start; } }
      .map-box {
        position: relative; height: 440px; border-radius: var(--radius); overflow: hidden;
        border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow);
      }
      #mapEl { position: absolute; inset: 0; }
      .map-fallback img { width: 100%; height: 100%; object-fit: cover; }
      .map-fallback { position: absolute; inset: 0; }
      .map-credit { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }
      .map-credit a { color: var(--green-dark); }
      .pin {
        width: 28px; height: 28px; border-radius: 999px 999px 999px 4px; transform: rotate(-45deg);
        background: var(--green); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.35);
        display: grid; place-items: center; font-size: 0.78rem; font-weight: 800;
      }
      .pin span { transform: rotate(45deg); }
      .pin--on { background: var(--green-deep); width: 34px; height: 34px; font-size: 0.9rem; }
      .map-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
      .map-row {
        display: flex; gap: 10px; align-items: center; text-align: left; width: 100%;
        background: var(--surface); border: 1.5px solid var(--line); border-radius: 11px; padding: 9px 11px;
      }
      .map-row:hover { border-color: var(--green); }
      .map-row.map-selected { border-color: var(--green); background: var(--green-tint); }
      .map-row .num {
        width: 24px; height: 24px; flex: none; border-radius: 999px; background: var(--green); color: #fff;
        display: grid; place-items: center; font-size: 0.78rem; font-weight: 800;
      }
      .map-row .mr-t { font-weight: 700; font-size: 0.9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
      .map-row .mr-p { font-weight: 800; color: var(--green-dark); font-size: 0.88rem; }
      @media (prefers-color-scheme: dark) { .map-row .mr-p { color: var(--green); } }
      .map-caption { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 10px; }

      /* ---------- Post listing ---------- */
      .post-section { margin: 34px 0 10px; }
      .post-card {
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 18px 18px;
      }
      .post-card h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
      .post-card h2 .free-word { color: var(--green-dark); }
      @media (prefers-color-scheme: dark) { .post-card h2 .free-word { color: var(--green); } }
      .post-card p.sub { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
      /* The card header itself is the login gate: heading + subline on the
         left, Login / Create account buttons on the right, one slim strip.
         No separate gate box — the form stays hidden until login. */
      .post-head { display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }
      .post-head-copy { flex: 1 1 340px; min-width: 0; }
      #postForm { margin-top: 16px; }
      #postForm[hidden] { display: none; }
      .post-gate-actions { display: flex; gap: 8px; align-items: center; flex: none; flex-wrap: wrap; }
      .post-gate-actions[hidden] { display: none; }
      .post-gate-login {
        background: var(--green); color: #fff; border: 1px solid var(--green); border-radius: 8px;
        font-weight: 700; font-size: 0.9rem; padding: 8px 20px; min-height: 2.5rem; white-space: nowrap;
      }
      .post-gate-login:hover { background: var(--green-dark); border-color: var(--green-dark); }
      .post-gate-signup {
        background: transparent; color: var(--green-dark); border: 1px solid var(--line); border-radius: 8px;
        font-weight: 700; font-size: 0.9rem; padding: 8px 16px; min-height: 2.5rem; white-space: nowrap;
      }
      .post-gate-signup:hover { border-color: var(--green); background: var(--green-tint); }
      @media (prefers-color-scheme: dark) { .post-gate-signup { color: var(--green); } }
      @media (max-width: 700px) {
        .post-head-copy { flex-basis: 100%; }
        .post-gate-actions { width: 100%; }
        .post-gate-login { flex: 1; }
        .post-gate-signup { flex: 1.4; }
      }
      .toggle-row { display: flex; gap: 8px; margin-bottom: 14px; }
      .toggle-row label {
        flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
        cursor: pointer; display: flex; gap: 9px; align-items: flex-start; min-height: 2.75rem;
      }
      .toggle-row label:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
      .toggle-row label.disabled { opacity: 0.55; cursor: default; }
      .toggle-row input { margin-top: 3px; accent-color: var(--green); width: 17px; height: 17px; flex: none; }
      .toggle-row .t { font-weight: 800; font-size: 0.95rem; display: block; }
      .toggle-row .d { font-size: 0.8rem; color: var(--ink-soft); display: block; }
      .form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
      @media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span2 { grid-column: span 2; } }
      .size-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
      .photo-drop {
        border: 1.5px dashed var(--line); border-radius: 10px; padding: 12px;
        display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface-2);
      }
      .photo-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
      .photo-thumbs[hidden] { display: none; }
      .photo-thumb { position: relative; flex: none; margin: 7px 7px 0 0; }
      .photo-thumb img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
      .photo-thumb .thumb-x {
        position: absolute; top: -8px; right: -8px; width: 25px; height: 25px; min-height: 0;
        border-radius: 999px; border: 2px solid var(--surface); background: var(--red); color: #fff;
        display: grid; place-items: center; padding: 0; box-shadow: var(--shadow);
      }
      .photo-empty {
        width: 120px; height: 80px; flex: none;
        border: 1.5px dashed var(--line); border-radius: 8px; background: var(--surface);
        display: grid; place-items: center; text-align: center; padding: 6px;
        color: var(--ink-faint); font-size: 0.78rem; font-weight: 700;
      }
      .photo-empty[hidden] { display: none; }
      .photo-drop .ph-actions { display: flex; flex-direction: column; gap: 6px; }
      .photo-pick {
        display: inline-flex; align-items: center; gap: 7px; background: var(--surface);
        border: 1.5px solid var(--green); color: var(--green-dark); font-weight: 800; font-size: 0.9rem;
        border-radius: 9px; padding: 8px 14px; cursor: pointer; min-height: 2.5rem;
      }
      @media (prefers-color-scheme: dark) { .photo-pick { color: var(--green); } }
      .photo-remove { background: none; border: 0; color: var(--red); font-weight: 700; font-size: 0.85rem; padding: 4px 0; min-height: 0; text-align: left; }
      .photo-hint { font-size: 0.8rem; color: var(--ink-faint); }
      .submit-btn {
        background: var(--green); color: #fff; border: 0; border-radius: 10px;
        font-weight: 800; font-size: 1.02rem; padding: 13px 22px; width: 100%;
        margin-top: 16px; display: inline-flex; justify-content: center; gap: 8px; align-items: center;
      }
      .submit-btn:hover { background: var(--green-dark); }
      @media (min-width: 700px) { .submit-btn { width: auto; } }
      .cancel-edit {
        background: none; border: 1.5px solid var(--line); color: var(--ink-soft); border-radius: 10px;
        font-weight: 700; padding: 12px 18px; margin-top: 16px; margin-left: 8px;
      }
      .form-err { color: #b3261e; font-size: 0.88rem; font-weight: 600; margin-top: 10px; display: none; }
      @media (prefers-color-scheme: dark) { .form-err { color: #f2a49e; } }

      /* ---------- Area autocomplete (Post Listing) ---------- */
      .area-ac-wrap { position: relative; }
      .area-ac-wrap > input { padding-right: 38px; }
      .area-ac-icon {
        position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
        color: var(--green); pointer-events: none; display: grid; place-items: center;
      }
      .area-suggestions {
        position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 45;
        background: var(--surface); border: 1.5px solid var(--line); border-radius: 11px;
        box-shadow: var(--shadow-lg); max-height: 264px; overflow-y: auto; padding: 5px;
      }
      .area-suggestions[hidden] { display: none; }
      .area-sugg-head {
        font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
        color: var(--ink-faint); padding: 7px 10px 4px;
      }
      .area-suggestion {
        display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
        background: none; border: 0; border-radius: 8px; padding: 9px 10px;
        font-size: 0.95rem; font-weight: 600; color: var(--ink); min-height: 2.6rem;
      }
      .area-suggestion svg { color: var(--green); flex: none; }
      .area-suggestion:hover { background: var(--surface-2); }
      .area-suggestion.active { background: var(--green-tint); }
      .area-suggestion .area-tag {
        margin-left: auto; flex: none; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
        text-transform: uppercase; color: var(--green-dark); background: var(--green-tint);
        padding: 2px 7px; border-radius: 999px;
      }
      @media (prefers-color-scheme: dark) { .area-suggestion .area-tag { color: var(--green); } }
      .area-no-match { padding: 10px 11px; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.45; }
      .area-no-match b { color: var(--ink); }

      /* ---------- Views (Saved / My Listings / Admin) ---------- */
      .view-head { margin: 24px 0 6px; }
      .view-head h2 { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
      .view-head p { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.93rem; }
      .status-pill {
        font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
        padding: 4px 9px; border-radius: 999px; flex: none;
      }
      .status-pill.approved { background: var(--green-tint); color: var(--green-dark); }
      @media (prefers-color-scheme: dark) { .status-pill.approved { color: var(--green); } }
      .status-pill.pending { background: var(--amber-bg); color: var(--amber); }
      .status-pill.rejected { background: var(--red-bg); color: var(--red); }
      .mine-row, .admin-row {
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 12px; display: flex; gap: 12px; align-items: flex-start;
        margin-bottom: 10px;
      }
      .mine-row img, .admin-row img { width: 96px; height: 68px; object-fit: cover; border-radius: 9px; flex: none; background: var(--surface-2); }
      .mine-row .info, .admin-row .info { flex: 1; min-width: 0; }
      .mine-row .info .t, .admin-row .info .t { font-weight: 700; line-height: 1.3; margin: 2px 0 3px; }
      .mine-row .info .m, .admin-row .info .m { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
      .row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
      .row-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
      .act-btn {
        border-radius: 8px; font-weight: 800; font-size: 0.85rem; padding: 8px 13px; border: 1.5px solid var(--line);
        background: var(--surface); color: var(--ink); min-height: 2.4rem;
      }
      .act-btn.approve { background: var(--green); border-color: var(--green); color: #fff; }
      .act-btn.approve:hover { background: var(--green-dark); }
      .act-btn.reject { color: var(--red); border-color: var(--red); background: var(--surface); }
      .act-btn.danger { color: var(--red); }
      .act-btn:hover { filter: brightness(0.97); }
      .act-btn.refresh { border-color: var(--green); color: var(--green-dark); display: inline-flex; align-items: center; gap: 6px; }
      @media (prefers-color-scheme: dark) { .act-btn.refresh { color: var(--green); } }
      .act-btn:disabled { opacity: 0.5; cursor: not-allowed; }
      .act-btn:disabled:hover { filter: none; }
      .refresh-note { font-size: 0.82rem; font-weight: 700; color: var(--ink-faint); align-self: center; }
      .stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
      @media (min-width: 700px) { .stat-cards { grid-template-columns: repeat(4, 1fr); } }
      .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
      .stat-card .n { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
      .stat-card .k { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
      .admin-h3 { font-size: 1.05rem; font-weight: 800; margin: 20px 0 10px; }

      /* ---------- Mobile safety: nothing clipped, nothing overflows ---------- */
      body { overflow-x: hidden; }
      .wrap, .card, .search-card, .post-card, .results-head { min-width: 0; }
      @media (max-width: 700px) {
        input, select, textarea { font-size: 16px; }
        .results-head { gap: 8px; }
        .results-head .spacer { display: none; }
        .sort-field { margin-left: auto; }
        .sort-field select { max-width: 46vw; }
        .view-toggle button, .lister-filter button { padding: 7px 11px; }
        /* Post Listing form: single column, big easy targets */
        .toggle-row { flex-direction: column; }
        .toggle-row label { padding: 13px 14px; }
        #postForm .field input, #postForm .field select, #postForm .field textarea {
          min-height: 3.1rem; padding: 12px 13px;
        }
        #postForm .size-row { grid-template-columns: 1fr 118px; }
        .photo-pick { min-height: 3rem; padding: 11px 16px; }
        .submit-btn { padding: 15px 22px; min-height: 3.4rem; }
        .cancel-edit { width: 100%; margin-left: 0; min-height: 3.1rem; }
        .mine-row, .admin-row { flex-direction: column; }
        .mine-row img, .admin-row img { width: 100%; height: 150px; }
        .mine-row .info, .admin-row .info { width: 100%; }
        .sheet-contact { grid-template-columns: 1fr 1fr; }
        .contact-row { grid-template-columns: 1fr 1fr; }
        .hero { padding: 30px 0 26px; background-position: center 30%; }
      }

      footer.site { margin-top: 36px; background: var(--green-deep); color: rgba(255,255,255,0.85); }
      footer.site .wrap { padding-top: 26px; padding-bottom: 26px; }
      footer.site .f-brand { color: #fff; font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
      .f-brand-mark {
        height: 36px; flex: none;
        display: flex; align-items: center;
      }
      .f-brand-mark img { height: 100%; width: auto; display: block; }
      footer.site p { margin: 4px 0; font-size: 0.88rem; max-width: 640px; }
      .footer-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
      @media (min-width: 760px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 26px; } }
      .footer-grid h3 { color: #fff; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 9px; }
      .footer-grid p { max-width: none; }
      .footer-grid ol.how { margin: 0; padding-left: 18px; font-size: 0.88rem; }
      .footer-grid ol.how li { margin: 3px 0; }
      .f-links { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
      .f-links button, .f-links a {
        background: none; border: 0; padding: 2px 0; min-height: 0;
        color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 600;
        text-decoration: none; text-align: left; cursor: pointer;
      }
      .f-links button:hover, .f-links a:hover { color: #fff; text-decoration: underline; }
      .footer-bottom {
        border-top: 1px solid rgba(255,255,255,0.18); margin-top: 22px; padding-top: 14px;
        font-size: 0.82rem; color: rgba(255,255,255,0.7);
        display: flex; flex-wrap: wrap; gap: 6px 16px;
      }

      /* ---------- Overlays (detail + auth) ---------- */
      .overlay {
        position: fixed; inset: 0; z-index: 60; background: rgba(8, 18, 10, 0.62);
        display: none; align-items: flex-end; justify-content: center;
      }
      .overlay.open { display: flex; }
      .sheet {
        background: var(--surface); color: var(--ink);
        width: 100%; max-width: 860px; max-height: 94dvh; overflow-y: auto;
        border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
      }
      .sheet.narrow { max-width: 480px; }
      @media (min-width: 700px) { .overlay { align-items: center; padding: 20px; } .sheet { border-radius: 18px; } }
      .sheet-head {
        position: sticky; top: 0; z-index: 2; background: var(--surface);
        display: flex; align-items: center; gap: 10px;
        padding: 12px 16px; border-bottom: 1px solid var(--line);
      }
      .sheet-head .t { font-weight: 800; font-size: 0.95rem; color: var(--ink-soft); letter-spacing: 0.03em; text-transform: uppercase; }
      .close-btn {
        margin-left: auto; width: 40px; height: 40px; border-radius: 999px;
        border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
        display: grid; place-items: center; flex: none; padding: 0;
      }
      .fav-btn.static { position: static; margin-left: auto; box-shadow: none; }
      .fav-btn.static + .close-btn { margin-left: 0; }
      .gallery-main { aspect-ratio: 16 / 9; background: var(--surface-2); }
      .gallery-main img { width: 100%; height: 100%; object-fit: cover; }
      .thumbs { display: flex; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; }
      .thumbs button { border: 2.5px solid transparent; border-radius: 9px; padding: 0; overflow: hidden; width: 92px; height: 62px; background: var(--surface-2); }
      .thumbs button[aria-pressed="true"] { border-color: var(--green); }
      .thumbs img { width: 100%; height: 100%; object-fit: cover; }
      .video-wrap {
        position: relative; aspect-ratio: 16 / 9; margin: 14px 16px 0;
        border-radius: 12px; overflow: hidden; background: #000;
      }
      .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
      .sheet-body { padding: 14px 16px 20px; }
      .sheet-body .price { font-size: 1.55rem; }
      .sheet-body h2 { margin: 4px 0 6px; font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.01em; }
      .facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 16px 0; }
      @media (min-width: 620px) { .facts { grid-template-columns: repeat(3, 1fr); } }
      .fact { background: var(--surface); padding: 10px 12px; }
      .fact .k { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
      .fact .v { font-weight: 700; font-size: 0.97rem; margin-top: 2px; }
      .sheet-body h3 { font-size: 1.02rem; margin: 18px 0 6px; }
      .sheet-body .desc { color: var(--ink-soft); margin: 0; white-space: pre-line; }
      .mission-block {
        background: var(--green-tint); border: 1px solid var(--line); border-radius: 12px;
        padding: 18px 16px; margin-bottom: 16px;
      }
      .mission-label {
        font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
        color: var(--green-dark); margin: 0 0 8px;
      }
      @media (prefers-color-scheme: dark) { .mission-label { color: var(--green); } }
      .mission-heading {
        font-family: "Plus Jakarta Sans", "Manrope", sans-serif;
        font-size: 1.45rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em;
        margin: 0; color: var(--ink);
      }
      .lister-box {
        border: 1.5px solid var(--line); border-radius: 12px; padding: 14px;
        display: flex; flex-direction: column; gap: 10px; margin-top: 18px;
      }
      .lister-box .who { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
      .lister-box .who .name { font-weight: 800; font-size: 1.02rem; }
      .lister-box .note { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
      .sheet-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

      /* ---------- Auth ---------- */
      .auth-body { padding: 16px; }
      .auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
      .auth-tabs button {
        flex: 1; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft);
        font-weight: 800; font-size: 0.95rem; border-radius: 9px; padding: 9px 6px;
      }
      .auth-tabs button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
      .auth-body .field { margin-bottom: 11px; }
      .auth-note {
        background: var(--amber-bg); border-radius: 9px; padding: 9px 12px;
        font-size: 0.86rem; font-weight: 600; margin-bottom: 12px; display: none;
      }
      .demo-accts { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 13px; }
      .demo-accts .k { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
      .demo-acct {
        display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
        border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px;
        padding: 9px 12px; margin-bottom: 7px; font-size: 0.88rem;
      }
      .demo-acct:hover { border-color: var(--green); }
      .demo-acct .da-t { font-weight: 800; display: block; }
      .demo-acct .da-c { color: var(--ink-soft); font-size: 0.8rem; display: block; }
      .demo-acct .da-go { margin-left: auto; font-weight: 800; color: var(--green-dark); flex: none; font-size: 0.85rem; }
      @media (prefers-color-scheme: dark) { .demo-acct .da-go { color: var(--green); } }

      .toast {
        position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
        background: var(--green-deep); color: #fff; font-weight: 700; font-size: 0.93rem;
        padding: 12px 18px; border-radius: 11px; box-shadow: var(--shadow-lg);
        opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
        z-index: 90; max-width: calc(100vw - 32px); text-align: center;
      }
      .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
      @media (prefers-reduced-motion: reduce) {
        html { scroll-behavior: auto; }
        .toast { transition: none; }
      }
      .link-btn { background: none; border: 0; padding: 0; color: var(--green-dark); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
