:root {
  --bg: #ffffff;
  --ink: #222222;
  --ink-soft: #717171;
  --border: #dddddd;
  --border-light: #ebebeb;
  --accent: #EE6F44;
  --accent-dark: #A74E30;
  --accent-soft: #FDEEE9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.18);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 6px 16px rgba(0,0,0,0.08);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ---------- Top bar ---------- */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 1200;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  flex-wrap: wrap;
  row-gap: 10px;
}

/* On the map page the search pill must stay visually centered on the page
   no matter how wide the logo/nav group on the left or the CTA button on
   the right happen to be — a 3-column grid (1fr / auto / 1fr) guarantees
   that regardless of the side content's widths, unlike flex + margin:auto
   which only centers within the leftover space between unequal siblings. */
.topbar-inner--3col {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.topbar-inner--3col .topbar-right {
  justify-self: end;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-org-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-grey {
  border: none;
  background: var(--border-light);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.btn-grey:hover { background: var(--border); }
.btn-grey:active { transform: scale(0.97); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  height: 52px;
  width: auto;
  flex-shrink: 0;
}

.brand-name {
  font-size: 21px;
  font-weight: 800;
  color: #000;
  letter-spacing: -0.02em;
}

.brand-dot { color: #000; }

.search-pill {
  width: 100%;
  max-width: 560px;
  justify-self: center;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
  background: #fff;
}

.search-pill:hover, .search-pill:focus-within {
  box-shadow: var(--shadow-md);
}

.search-seg {
  flex: 1;
  padding: 8px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.seg-what {
  border-right: 1px solid var(--border);
}

.search-seg label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 1px;
}

.search-seg input {
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  width: 100%;
  padding: 0;
}

.search-seg input::placeholder { color: var(--ink-soft); }

.seg-placeholder {
  font-size: 13.5px;
  color: var(--ink-soft);
}

.city-select {
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23717171'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23717171' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right center / 14px;
  width: 100%;
  padding: 0 18px 0 0;
  cursor: pointer;
}

.search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 6px 6px 6px 0;
  align-self: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.search-btn:hover { background: var(--accent-dark); }

.add-listing-btn {
  border: none;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  display: inline-block;
}

.add-listing-btn:hover { background: #262626; }
.add-listing-btn:active { transform: scale(0.97); }

.add-listing-btn-round {
  width: 40px;
  height: 40px;
  border: none;
  background: #000;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.add-listing-btn-round:hover { background: #262626; }
.add-listing-btn-round:active { transform: scale(0.94); }

/* ---------- Generic buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-primary:hover { background: #262626; }

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

.btn-outline:hover { background: #f7f7f7; }

/* ---------- Secondary page shell ---------- */

.page-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Real, visible SEO content below the map app — most of the site is a
   client-rendered map (see llms.txt), so this static section is what
   search engines/AI agents actually see and index without running JS. */
.seo-intro {
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.seo-intro-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.seo-intro h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.seo-intro h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 32px 0 8px;
}

.seo-intro p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 28px;
  line-height: 1.5;
}

.info-banner {
  background: #fff6e0;
  color: #7a5c14;
  border: 1px solid #f0dfa8;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.promo-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(15, 106, 117, 0.08);
  border: 1px solid rgba(15, 106, 117, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 28px;
}

.promo-card-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}

.promo-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.promo-card-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ---------- Forms ---------- */

.form-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23717171'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23717171' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 14px;
  padding-right: 32px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-note {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 6px;
}

.form-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-success {
  display: none;
  background: #eefaf1;
  border: 1px solid #bfe8cb;
  color: #1e6b34;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-top: 16px;
}

.form-success.show { display: block; }

.form-group input[type="file"] {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.file-hint {
  font-size: 12px;
  color: var(--accent-dark);
  font-weight: 600;
  margin-top: 6px;
}

.photo-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.photo-preview-thumb {
  position: relative;
  width: 64px;
  height: 64px;
}

.photo-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.photo-preview-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ---------- Full-screen photo gallery (shared: map popups, item sheet,
   admin pending queue + edit modal) ---------- */

.gallery-trigger { cursor: pointer; }

.photo-count-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.vinted-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.open { display: flex; }

.lightbox-track {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.lightbox-track.zoom-active { overflow-x: hidden; }

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

.lightbox-img-wrap {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.lightbox-img-wrap.zoomed {
  overflow: auto;
  cursor: zoom-out;
  align-items: flex-start;
  justify-content: flex-start;
  -webkit-overflow-scrolling: touch;
}

.lightbox-img-wrap::-webkit-scrollbar { display: none; }

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.lightbox-img-wrap.zoomed .lightbox-img {
  width: 250%;
  height: 250%;
  max-width: none;
}

.lightbox-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.lightbox-track.zoom-active ~ .lightbox-hint { display: none; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
}

.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: rgba(0,0,0,0.4);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

@media (max-width: 640px) {
  .lightbox-nav { display: none !important; }
}

/* ---------- Listing submission modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  width: 760px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-body {
  padding: 26px;
}

.modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px -36px 0;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  z-index: 5;
}

@media (max-width: 640px) {
  .modal-overlay { padding: 0; }
  .modal-card { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
}

/* ---------- Competitions page ---------- */

.comp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comp-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.comp-date {
  flex-shrink: 0;
  width: 62px;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 8px 4px;
}

.comp-date .day { font-size: 19px; font-weight: 800; line-height: 1.1; }
.comp-date .month { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }

.comp-info { flex: 1; min-width: 0; }

.comp-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }

.comp-meta { font-size: 12.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 10px; }

.comp-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  white-space: nowrap;
}

/* ---------- Links page ---------- */

.link-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 32px 0 12px;
}

.link-section-title:first-of-type { margin-top: 0; }

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.link-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.link-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.link-card-name {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.link-card-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 8px;
}

.link-card-url {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
}

.link-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-card-social {
  font-size: 15px;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.link-card-social:hover {
  opacity: 1;
}

/* ---------- Noticeboard ---------- */

.board-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.board-tab {
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.board-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

.board-post {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.board-post-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.board-post-title { font-size: 14.5px; font-weight: 700; line-height: 1.3; }

.board-post-city {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  white-space: nowrap;
}

.board-post-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 8px;
}

.board-post-date {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.board-post-contact {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
}

.section-heading {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 4px;
}

.section-subheading {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 28px 32px 36px;
  text-align: center;
}

.site-footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.site-footer-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.site-footer-nav a:hover { color: var(--ink); }

.site-footer-note {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.category-bar {
  display: flex;
  justify-content: center;
  gap: 30px;
  overflow-x: auto;
  padding: 4px 32px 14px;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar { display: none; }

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 6px 2px 10px;
  cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}

/* Only the emoji + label dim for an inactive tab — the icon photos stay at
   full opacity always, since dimming them (as a side effect of opacity on
   the whole button) made them look washed out. */
.cat-btn .cat-icon,
.cat-btn .cat-label {
  opacity: 0.75;
  transition: opacity 0.15s;
}

.cat-btn .cat-icon {
  font-size: 20px;
  line-height: 1;
}

.cat-btn .cat-icon-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  transition: transform 0.15s;
}

.cat-btn:hover .cat-icon-img {
  transform: scale(1.35);
}

.cat-btn .cat-label {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.cat-btn:hover {
  color: var(--ink);
}

.cat-btn:hover .cat-icon,
.cat-btn:hover .cat-label {
  opacity: 1;
}

.cat-btn.active {
  color: var(--ink);
  border-color: var(--ink);
  font-weight: 700;
}

.cat-btn.active .cat-icon,
.cat-btn.active .cat-label {
  opacity: 1;
}

/* Category tabs are clustered into named groups (e.g. "Sportininkams",
   "Mėgėjams") — each group is its own flex item so the tighter internal
   gap (between a group's label and its buttons) reads differently from
   the wider gap the category-bar itself puts between groups. */
.cat-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* ---------- Layout ---------- */

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

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  flex: 1 1 50%;
  max-width: 50%;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Stays pinned at the top while results-count/subtitle and the list scroll
   underneath — only the drag handle (mobile) and the varžybos filters. */
.sidebar-pinned {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
  flex-shrink: 0;
}

.results-count {
  padding: 18px 24px 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.results-subtitle {
  padding: 2px 24px 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Competition timeline (Varžybos tab) ---------- */

.comp-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 24px 0;
}

.comp-filter-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23717171' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 12px center / 12px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 30px 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.comp-filter-select.active {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* .comp-timeline replaces the normal card grid inside #listingList for the
   Varžybos category — but #listingList is itself a CSS grid
   (repeat(auto-fill, minmax(...,1fr))) sized for many small cards. Without
   this, a single .comp-timeline element becomes one grid item and gets
   squeezed to a single auto-fill column's width (as narrow as ~140px on
   mobile) instead of spanning the full sidebar — same fix already used for
   .no-results/.other-cat-notice. */
.comp-timeline {
  grid-column: 1 / -1;
  width: 100%;
  padding: 4px 0 32px;
  display: flex;
  flex-direction: column;
}

.comp-month-header {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 20px 0 10px;
}

/* Wide single-row-per-event layout (not a card grid) — closer to a real
   timeline/agenda list. Date sits inline at the left of each row rather
   than in a separate shared per-day column, so rows stay robust at any
   sidebar width instead of relying on a fixed-width neighbor column. */
.comp-row {
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.comp-row:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Past events: greyed out but still present (sorted chronologically, so
   they naturally end up above the upcoming ones — scroll up to find them).
   They deliberately don't get an auto-added map marker (see app.js); tapping
   one still adds/opens its marker on demand. */
.comp-row.past {
  border-left-color: var(--border);
  opacity: 0.5;
}

.comp-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

/* Reused inside the map popup / mobile item sheet for competitions so the
   info + layout matches the sidebar row exactly — not a real list row there. */
.comp-popup-row {
  cursor: default;
  border: none;
  border-radius: 0;
  /* Extra right padding so the title/badges never run under the Leaflet
     popup's floating close button (absolutely positioned, not part of flow). */
  padding: 16px 40px 16px 16px;
}
.comp-popup-row:hover { box-shadow: none; }

.comp-row-date {
  flex-shrink: 0;
  width: 42px;
  text-align: center;
}

.comp-row-day {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}

.comp-row-month {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.comp-row-body {
  flex: 1;
  min-width: 0;
}

.comp-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.comp-row-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}

.comp-row-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.comp-event-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  white-space: nowrap;
}

.comp-row-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}

.comp-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}


a.comp-website-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  transition: background 0.15s;
}

a.comp-website-btn:hover { background: var(--ink); }

.listing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  column-gap: 24px;
  row-gap: 40px;
  padding: 16px 24px 32px;
  align-content: start;
}

.listing-card {
  cursor: pointer;
  background: #fff;
  transition: transform 0.15s ease;
}

.listing-card:hover {
  transform: translateY(-2px);
}

.listing-card:hover .lc-photo img,
.listing-card:hover .lc-photo {
  filter: brightness(1.02);
}

.lc-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  background: var(--border-light);
}

.lc-photo img:not(.vinted-badge) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Category default (a generic transparent illustration, not a real photo of
   this specific place) — shown smaller and inset instead of stretched to
   fill the frame, so it doesn't look like a real photo of the listing. */
.lc-photo img.default-photo {
  position: static;
  width: 65%;
  height: 65%;
  object-fit: contain;
}

.map-card-photo img:not(.vinted-badge) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lc-photo-icon {
  font-size: 46px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.lc-cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
}

.lc-body {
  padding: 10px 2px 0;
}

.lc-top-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.lc-name {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.3;
}

.lc-city {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.lc-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lc-price {
  font-size: 13.5px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.lc-price strong {
  font-weight: 700;
}

.no-results {
  grid-column: 1 / -1;
  padding: 60px 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.other-cat-notice {
  grid-column: 1 / -1;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* "Add a listing" card — same shape as a real listing-card, styled grey
   so it reads as an invite rather than actual content. */
.add-listing-card {
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  text-align: left;
  font-family: inherit;
  display: block;
  width: 100%;
}

.add-listing-photo {
  background: none;
  border: 2px dashed var(--border);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.add-listing-card:hover .add-listing-photo {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-listing-photo .add-listing-plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--ink-soft);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.add-listing-card:hover .add-listing-plus {
  background: var(--accent);
  color: #fff;
}

.add-listing-card .lc-name { color: var(--ink-soft); }
.add-listing-card:hover .lc-name { color: var(--ink); }

.minor-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.minor-link:hover { color: var(--ink); }

.map-wrap {
  flex: 1 1 50%;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.menu-toggle {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  /* Higher than .sidebar's open z-index (1150) so the toggle stays visible
     and clickable (to switch back to the map) even while the list drawer
     covers the map underneath. */
  z-index: 1160;
  background: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.map-org-extra-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-dark);
}

/* ---------- Topbar org-logo buttons (top-right, replaces Nuorodos/+) ---------- */

.topbar-org-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border-light);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.topbar-org-btn:hover { transform: scale(1.08); }

.topbar-org-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-org-card {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1199;
  width: 280px;
  max-width: 90vw;
  margin-top: 8px;
}

.topbar-org-card .link-card {
  box-shadow: var(--shadow-lg);
}

/* Mobile: sits as a footer at the end of the scrollable list/detail
   content instead of in the topbar (see .topbar-right { display:none }
   inside the mobile media query). */
.mobile-org-buttons {
  display: none;
  justify-content: center;
  gap: 14px;
  padding: 20px 24px 28px;
}

.mobile-org-buttons .topbar-org-btn {
  width: 44px;
  height: 44px;
}

.mobile-org-card {
  position: relative;
  width: calc(100% - 48px);
  max-width: 320px;
  margin: 0 auto 20px;
}

.mobile-org-card .link-card {
  box-shadow: var(--shadow-lg);
}

.price-pill-wrapper {
  background: transparent;
  border: none;
}

.price-pill {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease, color 0.1s ease;
}

.price-pill:hover {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 10000 !important;
}

.price-pill-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.price-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.price-pill .pill-icon {
  font-size: 12px;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md);
}

/* ---------- Zoom control — restyled to match the site's flat,
   token-based look instead of Leaflet's default boxy black-bordered
   buttons. ---------- */
.leaflet-control-zoom {
  border: none !important;
  border-radius: var(--radius-md) !important;
  /* !important: Leaflet's own .leaflet-touch .leaflet-bar rule (higher
     specificity, applied whenever a touch-capable browser is detected)
     otherwise zeroes this out. */
  box-shadow: var(--shadow-md) !important;
  overflow: hidden;
}

.leaflet-control-zoom a,
.leaflet-control-zoom a:link {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  background: #fff !important;
  color: var(--ink) !important;
  border: none !important;
  font-family: "Inter", sans-serif;
  font-size: 18px !important;
  font-weight: 600;
}

.leaflet-control-zoom a:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  border-bottom: 1px solid var(--border-light) !important;
}

.leaflet-control-zoom a:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--border-light) !important;
}

/* ---------- On-map listing card (popup) ---------- */

.map-card-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.map-card-popup .leaflet-popup-content {
  margin: 0;
  width: 380px !important;
}

.map-card-popup .leaflet-popup-close-button {
  top: 10px !important;
  right: 10px !important;
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 15px !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-md);
}

.map-card-photo {
  position: relative;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
}

.map-card-photo-icon {
  font-size: 46px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.map-card-body {
  padding: 14px 16px 16px;
}

.map-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
}

.map-card-city {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.map-card-price {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.map-card-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 4px;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ---------- Full listing detail view (desktop sidebar) — replaces the
   list when a listing is selected (list click or marker click); "← Atgal"
   restores the list via closeListingDetail(). ---------- */

.listing-detail {
  padding: 0 24px 40px;
}

.detail-back-btn {
  position: sticky;
  top: 0;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--border-light);
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  cursor: pointer;
  margin: 16px 0 14px;
}

.detail-back-btn:hover { background: var(--border); }

.detail-photo-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  scroll-snap-type: x proximity;
}

.detail-photo-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 150px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--border-light);
  box-shadow: var(--shadow-card);
}

.detail-photo-empty {
  width: 150px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.listing-detail-title {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
  margin: 4px 0 4px;
}

.listing-detail-city {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.listing-detail-price {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
}

.listing-detail-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-line;
  margin-bottom: 4px;
}

/* Contact info is shown as plain (but clickable) text, not a button —
   only the "learn more elsewhere" links (website/social) get icon
   buttons. Keeps the card from needing 4-5 equal-width pill buttons
   crammed into ~300px, which used to clip/overflow. */
.contact-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.contact-line svg {
  flex-shrink: 0;
  color: var(--ink-soft);
}

.contact-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.external-listing-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, background 0.15s;
}

.external-listing-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.external-listing-icon { font-size: 18px; }

.external-listing-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.external-listing-url {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
}

.contact-icon-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  background: #fff;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.contact-icon-btn:hover {
  background: var(--border-light);
  color: var(--ink);
  border-color: var(--border);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .sidebar { max-width: 100%; flex-basis: 100%; }
}

@media (max-width: 860px) {
  /* Touch devices zoom the map with a pinch gesture — the on-screen +/-
     buttons just take up space and overlap the sheet-toggle pill. */
  .leaflet-control-zoom { display: none; }

  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .category-bar { padding: 4px 16px 12px; gap: 20px; }
  .topbar-right { display: none; }
  /* Full-page list only — not inside the map-mode bottom sheet. */
  .layout.view-list .mobile-org-buttons { display: flex; }
  .search-seg { padding: 8px 14px; }
  .add-listing-btn { padding: 10px 14px; font-size: 12.5px; }
  .btn-grey { padding: 10px 14px; font-size: 12.5px; }

  /* The 3-column grid (logo / search / buttons) only has room to breathe
     on wide screens. Below this breakpoint, stack it: the brand name gets
     its own centered row, then the search pill underneath. */
  .topbar-inner--3col {
    display: flex;
    flex-wrap: wrap;
  }
  .topbar-inner--3col .topbar-left {
    order: 1;
    flex-basis: 100%;
    justify-content: center;
  }
  .topbar-inner--3col .topbar-right { order: 2; justify-self: initial; margin-left: auto; }
  .topbar-inner--3col .search-pill {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }

  .page-shell { padding: 28px 16px 60px; }
  .page-title { font-size: 24px; }

  .form-card { padding: 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }

  .link-grid, .board-grid { grid-template-columns: 1fr; }

  .layout { position: relative; }

  .menu-toggle { display: block; }

  /* Airbnb-style mobile flow: first screen is a plain full-page LIST
     (map hidden); performing a search switches to a full-screen MAP with
     a draggable bottom sheet of results peeking up from the bottom. A
     floating pill (repurposed .menu-toggle) lets the user flip between
     the two at any time, regardless of whether they've searched. */
  .layout.view-list .map-wrap { display: none; }

  .layout.view-list .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    max-width: 100%;
    transform: none;
    z-index: auto;
  }

  .layout.view-map .map-wrap { display: block; }

  .layout.view-map .sidebar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    /* Below .menu-toggle (1160) and .topbar (1200); above Leaflet's own
       panes so the sheet visually sits on top of the map underneath it. */
    z-index: 950;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(0,0,0,0.16);
    height: 40vh;
    transition: height 0.25s ease;
  }

  .layout.view-map .sidebar.sheet-full {
    height: 88vh;
  }

  /* Default height when a specific listing is opened (vs. just browsing the
     results list) — taller than "peek" so its photo/title/price are visible
     without immediately having to drag the sheet up. */
  .layout.view-map .sidebar.sheet-item {
    height: 62vh;
  }

  .sheet-handle {
    display: none;
  }

  .layout.view-map .sheet-handle {
    display: block;
    flex-shrink: 0;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 10px auto 4px;
    cursor: grab;
    touch-action: none;
  }

  .layout.view-map .results-count {
    padding: 4px 20px 4px;
    font-size: 16px;
  }

  .listing-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); column-gap: 16px; row-gap: 48px; padding: 12px 16px 24px; }

  .layout.view-map .listing-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); column-gap: 12px; row-gap: 42px; padding: 8px 16px 24px; }

  .map-card-popup .leaflet-popup-content { width: 300px !important; }

  /* The sheet is short (peek/item states) on mobile — an open-ended 4:3
     photo alone could eat the whole visible height, pushing the title/
     price/description below the fold. Cap it so there's always room. */
  .listing-detail { padding: 0 16px 32px; }
  .detail-photo-item,
  .detail-photo-empty { width: 120px; }
  /* Clears the draggable sheet-handle (also sticky at top:0 above the
     detail view) so the two don't paint on top of each other. */
  .detail-back-btn { margin: 12px 0 10px; top: 20px; }

  /* ---------- Mobile item-detail bottom sheet ---------- */
  .item-sheet-overlay {
    align-items: flex-end;
  }

  .item-sheet {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 18px 18px 0 0;
    animation: sheet-slide-up 0.22s ease;
  }

  .item-sheet .map-card-photo { border-radius: 0; }
}

.item-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
}

.item-sheet-overlay.open {
  display: flex;
}

.item-sheet {
  position: relative;
  background: #fff;
  width: 400px;
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.item-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  cursor: grab;
  touch-action: none;
}

.item-sheet-close {
  position: sticky;
  top: 10px;
  float: right;
  margin: 0 12px -34px 0;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
}

.item-sheet-body {
  padding: 6px 0 20px;
}

/* Tile-provider attribution — collapsed to a small "i" icon by default,
   expands on click. Prevents the long Esri credits list from dominating
   the map corner (esp. on mobile). */
.leaflet-control-attribution {
  cursor: pointer;
  font-size: 11px;
  line-height: 1.4;
  padding: 2px 6px;
  max-width: 260px;
}

.leaflet-control-attribution .attr-toggle {
  font-weight: 600;
  color: #6b6b6b;
}

.leaflet-control-attribution.attr-collapsed .attr-text {
  display: none;
}

.leaflet-control-attribution:not(.attr-collapsed) .attr-toggle {
  display: none;
}

/* ---------- Toast notification ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(90vw, 420px);
  text-align: center;
}

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