/* Second Hand — modern marketplace styling: glassmorphism nav, 3D-tilt cards,
   animated gradient hero, scroll-reveal micro-interactions. */
:root {
  --brand: #ffce00;
  --brand2: #ffe49a;
  --brand-dark: #e0b400;
  --ink: #20222b;
  --muted: #74758a;
  --line: #e7e7f0;
  --bg: #f4f5f9;
  --card: #ffffff;
  --ok: #1e9e57;
  --warn: #c98a00;
  --bad: #d23c3c;
  --biz: #0d9488;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 20, 50, .06);
  --shadow-lg: 0 18px 38px rgba(20, 20, 50, .16), 0 4px 12px rgba(20, 20, 50, .08);
  --glass-bg: rgba(255, 255, 255, .72);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Heebo", "Segoe UI", "Assistant", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

/* Header — glassmorphism, elevates on scroll */
.topbar {
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, .5);
  position: sticky; top: 0; z-index: 50;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.topbar.scrolled {
  box-shadow: 0 6px 24px rgba(20, 20, 50, .10);
  border-bottom-color: var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.logo-mark {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: 8px; padding: 4px 8px;
  box-shadow: 0 3px 8px rgba(224, 180, 0, .35);
}

/* Always-visible auth area (Login/Register, or the user's avatar badge) —
   kept outside the collapsible .mainnav so it never gets hidden behind the
   mobile hamburger toggle. */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-auth { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.avatar-badge {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-weight: 800; font-size: 13px; color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

/* Mobile nav toggle — hidden on desktop, shown only under the phone breakpoint below. */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-toggle span { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--ink); border-radius: 2px; }
.mainnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; transition: background .15s, transform .15s; }
.nav-link:hover { background: rgba(0, 0, 0, .05); transform: translateY(-1px); }
.nav-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 4px 12px rgba(224, 180, 0, .35);
}
.nav-cta:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(224, 180, 0, .65); }
.nav-user { color: var(--muted); font-size: 14px; }
.nav-fav-link { position: relative; font-size: 17px; padding-inline-end: 16px; }
.nav-fav-count {
  position: absolute; top: 2px; inset-inline-end: 2px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 15px; height: 15px; line-height: 15px;
  text-align: center; border-radius: 50%; padding: 0 3px;
}
.lang-switch {
  display: flex; align-items: center; gap: 2px; margin-inline-start: 6px;
  border: 1px solid var(--line); border-radius: 8px; padding: 2px;
}
.lang-link {
  padding: 5px 9px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--muted);
  transition: background .15s;
}
.lang-link:hover { background: var(--bg); }
.lang-link.active { background: var(--brand); color: var(--ink); }

/* Containers */
.container { max-width: 1000px; margin: 24px auto; padding: 0 20px; }
.container-full { max-width: 1400px; margin: 24px auto; padding: 0 20px; }
.legal-page { max-width: 720px; margin: 0 auto; line-height: 1.6; }
.legal-page h2 { margin-top: 28px; font-size: 18px; }

/* Hero — animated gradient + floating blobs */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, var(--brand) 0%, var(--brand2) 100%);
  background-size: 200% 200%;
  animation: heroShift 14s ease-in-out infinite;
  border-radius: 22px; padding: 56px 24px; text-align: center; margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}
@keyframes heroShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(40px); opacity: .35; pointer-events: none;
  animation: blobFloat 9s ease-in-out infinite;
}
.hero-blob-1 { width: 220px; height: 220px; background: #fff; top: -60px; inset-inline-start: -40px; }
.hero-blob-2 {
  width: 260px; height: 260px; background: #ffffff; bottom: -90px; inset-inline-end: -60px;
  animation-delay: -4s; animation-duration: 11s;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(14px, -16px) scale(1.08); }
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 20px; font-size: 32px; font-weight: 800; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.hero-search { display: flex; max-width: 560px; margin: 0 auto; gap: 8px; }
.hero-search input {
  flex: 1; padding: 14px 16px; border: none; border-radius: 12px; font-size: 16px;
  box-shadow: var(--shadow); font-family: inherit;
}
.hero-search button {
  padding: 14px 28px; border: none; border-radius: 12px; background: var(--ink);
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.hero-search button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.4); }
.hero-search button:active { transform: translateY(0); }
.hero-sell-btn {
  display: inline-block; margin-top: 18px; padding: 14px 30px; font-size: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

/* Scroll reveal (progressive enhancement — see app.js) */
.reveal-init { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal-init.in-view { opacity: 1; transform: none; }

/* Categories */
.cats h2, .block h2 { font-size: 21px; margin: 0 0 14px; font-weight: 800; }
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 12px;
}
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 10px; text-align: center; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cat-card:hover { transform: translateY(-5px) scale(1.03); border-color: var(--brand); box-shadow: var(--shadow-lg); }
.cat-icon { font-size: 30px; display: block; transition: transform .2s ease; }
.cat-card:hover .cat-icon { transform: scale(1.15) rotate(-4deg); }
.cat-name { font-weight: 600; font-size: 14px; margin-top: 6px; display: block; }
.block { margin-top: 36px; }

/* Listing grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 18px; }
.card-wrap { position: relative; }
.card {
  display: block;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card-wrap:hover .card { box-shadow: var(--shadow-lg); }
.card-img {
  height: 168px; background-size: cover; background-position: center;
  background-color: #eee; position: relative;
}
.badge-feat {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.badge-sold {
  position: absolute; top: 8px; inset-inline-end: 8px; background: var(--bad);
  color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.badge-biz {
  position: absolute; bottom: 8px; inset-inline-start: 8px; background: var(--biz);
  color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.card-archived {
  filter: grayscale(1); opacity: .6; cursor: default; box-shadow: none !important;
}
.card-archived:hover { transform: none; }
.badge-removed {
  position: absolute; top: 8px; inset-inline-start: 8px; background: #4b5563;
  color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.card-body { padding: 12px; }
.card-price { font-size: 19px; font-weight: 800; }
.card-title {
  font-size: 15px; margin: 4px 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta { color: var(--muted); font-size: 13px; }
.card-time { color: var(--muted); font-size: 12px; margin-top: 4px; }
.empty { padding: 30px; text-align: center; }

/* Quick admin delete — floating icon button on cards */
.quick-delete-form { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 5; margin: 0; }
/* Sold badge occupies the same top-right corner — push the button below it
   so the two never overlap. */
.quick-delete-form.quick-delete-form-offset { top: 44px; }
.quick-delete-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20, 20, 30, .55); color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background .15s, transform .15s;
}
.quick-delete-btn:hover { background: var(--bad); transform: scale(1.1); }

/* Quick "remove from favorites" heart button on favorite cards */
.fav-remove-form { position: absolute; bottom: 8px; inset-inline-end: 8px; z-index: 5; margin: 0; }

/* Inline (non-floating) variants used inside the list-view table, where
   buttons sit in their own dedicated column instead of overlapping content. */
.quick-delete-form-inline, .fav-remove-form-inline { display: inline-block; margin: 0 3px; }
.fav-remove-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20, 20, 30, .55); color: var(--brand); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background .15s, transform .15s;
}
.fav-remove-btn:hover { background: var(--bad); color: #fff; transform: scale(1.1); }

/* Corner slots: stack overlay buttons (sold badge / heart / delete) in the
   top-right of a card image so they never overlap. */
.corner-slot-0 { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 5; margin: 0; }
.corner-slot-1 { position: absolute; top: 46px; inset-inline-end: 8px; z-index: 5; margin: 0; }
.corner-slot-2 { position: absolute; top: 84px; inset-inline-end: 8px; z-index: 5; margin: 0; }

/* Small favorite heart overlaid on a card image (top-right). */
.card-fav-btn {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; gap: 0;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.card-fav-btn .heart-icon { width: 19px; height: 19px; }
.card-fav-btn:hover { background: #fff; }

/* Favorite heart toggle: outline when not saved, filled red when saved. */
.fav-heart-form { margin: 0; }
.fav-heart {
  background: none; border: none; cursor: pointer; padding: 6px;
  display: inline-flex; align-items: center; gap: 8px; color: #e0245e;
  font-weight: 600;
}
.fav-heart .heart-icon {
  width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2;
  transition: fill .15s ease, transform .1s ease;
}
.fav-heart:hover .heart-icon { transform: scale(1.12); }
.fav-heart.is-fav .heart-icon { fill: #e0245e; stroke: #e0245e; }
.fav-heart-label { color: var(--ink); font-size: 14px; }
/* Floating heart on cards: keep it a compact circular button, icon only. */
.fav-remove-form .fav-remove-btn, .fav-remove-form-inline .fav-remove-btn {
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(4px);
}
.fav-remove-form .fav-remove-btn .heart-icon,
.fav-remove-form-inline .fav-remove-btn .heart-icon { width: 20px; height: 20px; }
.fav-remove-form .fav-remove-btn:hover { transform: scale(1.12); background: #fff; }

/* Page headings */
.page-h1 { font-size: 27px; margin: 8px 0 18px; font-weight: 800; }
.muted { color: var(--muted); }

/* Subcategory chips on a parent category page */
.subcat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.subcat-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.subcat-chip:hover { transform: translateY(-2px); border-color: var(--brand); }

/* Admin category table: inline-editable hierarchical rows */
.cat-depth-indent { color: var(--muted); white-space: pre; }
.cat-icon-input { width: 52px; text-align: center; }
.table select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit;
  cursor: pointer; transition: box-shadow .15s ease;
}
.table select:hover { box-shadow: 0 6px 14px rgba(0,0,0,.18); }

/* Filters / toolbar */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }
/* Keep min / max / currency together; the currency sits right after max. */
.filter-price-group { display: inline-flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.filter-price-group input { width: 110px; }
.filter-currency { width: auto; min-width: 84px; }
@media (max-width: 760px) { .filter-price-group { flex-wrap: wrap; } .filter-price-group input { width: 100%; } }
.filters button {
  padding: 10px 20px; border: none; background: var(--ink); color: #fff;
  border-radius: 8px; font-weight: 700; cursor: pointer; transition: transform .15s;
}
.filters button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sort-form { display: inline-block; }
.sort-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sort-label select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit;
  background: var(--card); font-weight: 600; color: var(--ink); cursor: pointer;
  transition: box-shadow .15s ease;
}
.sort-label select:hover { box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; }
.page-info { color: var(--muted); font-size: 14px; font-weight: 600; }

/* Gallery / list view toggle */
.view-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--card);
}
.view-toggle-btn { padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.view-toggle-btn:hover { background: var(--bg); box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.view-toggle-btn.active { background: var(--brand); color: var(--ink); }

/* Compact row layout — reused by the inbox thread list (no per-field columns
   needed there; the full-table layout below is for listing list view). */
.listing-list { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.list-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.list-thumb {
  width: 84px; height: 64px; border-radius: 8px; background-size: cover;
  background-position: center; background-color: #eee; flex-shrink: 0;
}
.list-info { flex: 1; min-width: 0; }
.list-title {
  font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; display: flex; align-items: center; gap: 6px;
}
.list-meta { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-mini {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; flex-shrink: 0;
}
.badge-mini-feat { background: var(--brand); }
.badge-mini-sold { background: var(--bad); color: #fff; }
.badge-mini-biz { background: var(--biz); color: #fff; }

/* List view: real table, one column per field. Each row navigates on click;
   the actions cell stops propagation so its buttons don't also trigger it. */
.listing-table .list-table-row, .table .list-table-row { cursor: pointer; }
.listing-table .list-table-thumb { width: 90px; }
.listing-table .list-thumb { width: 72px; height: 54px; }
.list-table-title { font-weight: 700; }
.list-table-price { font-weight: 800; white-space: nowrap; }
.list-table-actions { white-space: nowrap; }
.list-table-actions .quick-delete-form-inline .quick-delete-btn,
.list-table-actions .fav-remove-form-inline .fav-remove-btn {
  width: 26px; height: 26px; font-size: 13px; background: var(--bg); color: inherit;
  backdrop-filter: none;
}
.list-table-actions .quick-delete-form-inline .quick-delete-btn:hover { background: var(--bad); color: #fff; }
.list-table-actions .fav-remove-form-inline .fav-remove-btn:hover { background: var(--bad); color: #fff; }

/* Detail */
.detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start; }
.detail-main-wrap { position: relative; }
/* Favorite heart overlaid on the top corner of the main listing photo */
.detail-fav-form { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 4; margin: 0; }
.detail-fav-btn { width: 46px; height: 46px; }
.detail-fav-btn .heart-icon { width: 25px; height: 25px; }
.detail-main {
  width: 100%; border-radius: var(--radius); background: #eee; aspect-ratio: 4/3;
  object-fit: contain; box-shadow: var(--shadow); cursor: zoom-in; display: block;
  touch-action: pan-y;  /* let vertical scroll through; we handle horizontal swipe */
}
/* Inline prev/next arrows over the main photo (multi-image listings) */
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0, 0, 0, .45); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1;
  cursor: pointer; z-index: 4; display: none; align-items: center; justify-content: center;
  transition: background .15s;
}
.detail-main-wrap.has-multiple .gallery-nav { display: flex; }
.gallery-nav:hover { background: rgba(0, 0, 0, .7); }
.gallery-prev { inset-inline-start: 10px; }
.gallery-next { inset-inline-end: 10px; }

/* Lightbox — click the main image to view it full-size */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 16, .88);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-img {
  max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5); cursor: zoom-in;
  transform-origin: center center; transition: transform .08s ease-out;
  touch-action: none; will-change: transform;
}
.lightbox-img.zoomed { cursor: grab; transition: none; }
.lightbox-close {
  position: absolute; top: 18px; inset-inline-end: 22px; background: rgba(255, 255, 255, .15);
  color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%;
  font-size: 24px; line-height: 1; cursor: pointer; transition: background .15s; z-index: 2;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .3); }
/* Prev/next arrows in the lightbox (hidden by JS when a listing has one photo) */
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(255, 255, 255, .15); color: #fff; border: none;
  width: 48px; height: 48px; border-radius: 50%; font-size: 22px; line-height: 1;
  cursor: pointer; transition: background .15s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .32); }
.lightbox-prev { inset-inline-start: 18px; }
.lightbox-next { inset-inline-end: 18px; }
@media (max-width: 760px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 18px; }
  .lightbox-prev { inset-inline-start: 8px; }
  .lightbox-next { inset-inline-end: 8px; }
}
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); transition: transform .15s;
}
.thumb:hover { transform: translateY(-2px) scale(1.05); }
.thumb-wrap { position: relative; display: inline-block; }
.thumb-remove-btn {
  position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--bad); color: #fff; border: 2px solid var(--card);
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.detail-info h1 { margin: 0 0 6px; font-size: 27px; font-weight: 800; }
.detail-price { font-size: 31px; font-weight: 900; color: var(--ink); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); margin: 14px 0; font-size: 14px; }
.seller-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 16px 0; box-shadow: var(--shadow);
}
.seller-box h3 { margin: 0 0 8px; }
.seller-box .phone { font-size: 18px; font-weight: 700; }
.seller-type-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  margin-inline-start: 6px; vertical-align: middle;
}
.seller-type-private { background: var(--bg); color: var(--muted); }
.seller-type-business { background: #ccfbf1; color: var(--biz); }
.phone-reveal { margin-top: 10px; }
.phone-number {
  display: inline-flex; align-items: center; font-size: 18px; font-weight: 700;
  padding: 10px 16px; border-radius: 8px; background: var(--bg);
}
.contact-box h3 { margin-bottom: 10px; }
.contact-form { display: flex; flex-direction: column; gap: 10px; }
.contact-form input, .contact-form textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(255, 206, 0, .25);
}
.detail-desc {
  margin-top: 28px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.owner-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Buttons — layered depth + press feedback */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); font-weight: 700; cursor: pointer; font-size: 14px;
  font-family: inherit; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 2px 5px rgba(20,20,50,.06);
}
.btn:hover { background: var(--bg); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20,20,50,.24); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 5px rgba(20,20,50,.08); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: var(--brand-dark); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-light { background: var(--card); }
.btn-danger { color: var(--bad); border-color: #f3c0c0; }
.btn-danger:hover { background: #fdeaea; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Forms */
.bigform, .auth-box form {
  display: flex; flex-direction: column; gap: 14px; max-width: 640px;
  background: var(--card); padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.bigform label, .auth-box label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.bigform input, .bigform select, .bigform textarea,
.auth-box input {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.bigform select:hover { box-shadow: 0 6px 14px rgba(0,0,0,.18); cursor: pointer; }
.bigform input:focus, .bigform select:focus, .bigform textarea:focus, .auth-box input:focus {
  outline: none; border-color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(255, 206, 0, .25);
}
.location-picker #geo-locate-btn { margin-bottom: 10px; }
.bigform .row { display: flex; gap: 14px; flex-wrap: wrap; }
.bigform .image-input-row { display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; }
.bigform label.image-input-btn {
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center;
  width: auto; text-align: center;
}
.bigform .row label { flex: 1; min-width: 160px; }
.bigform .check, .auth-box .check {
  flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 500;
}
.form-sep { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.lang-checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; }
.lang-checkbox-row .check { font-weight: 500; }
.form-subheading { font-size: 16px; font-weight: 800; margin: 0; }
.bigform .color-row { align-items: flex-end; }
.color-field { flex: 1; min-width: 160px; }
.color-input-row { display: flex; align-items: center; gap: 10px; }
.color-input-row input[type="color"] {
  width: 44px; height: 40px; padding: 2px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
}
.color-hex {
  font-family: monospace; font-weight: 700; font-size: 14px; color: var(--muted);
  letter-spacing: .5px;
}
.auth-box { max-width: 420px; margin: 30px auto; }
.auth-box h1 { text-align: center; }
.alert { background: #fdeaea; color: var(--bad); padding: 12px; border-radius: 8px; }
.alert-ok { background: #e7f7ee; color: var(--ok); }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg); font-size: 13px; color: var(--muted); }
.table tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 206, 0, .07); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.table .actions .btn-sm { padding: 6px 10px; font-size: 12px; }
.table .actions.actions-nowrap { flex-wrap: nowrap; white-space: nowrap; }
.feedback-desc-col { min-width: 160px; max-width: 340px; white-space: normal; word-break: break-word; }
.sort-th-link { color: inherit; font-weight: inherit; white-space: nowrap; }
.sort-th-link:hover { color: var(--ink); text-decoration: underline; }

/* Sortable column headers */
.sort-link { color: var(--muted); font-weight: inherit; white-space: nowrap; }
.sort-link:hover { color: var(--ink); text-decoration: underline; }
.sort-link.active { color: var(--ink); }

/* Feedback status controls */
.fb-status-select { padding: 5px 8px; font-size: 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); max-width: 150px; }
.fb-voting-state { font-size: 11px; margin-top: 4px; }
.badge-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 700; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge-status-done, .badge-status-tested { background: #e6f7ed; border-color: #b7e6c9; color: #1a7f43; }
.badge-status-dev_queue { background: #eaf1ff; border-color: #c5d8ff; color: #2a5bd7; }
.badge-status-archived { background: #f1f1f3; color: #8a8a94; }

/* Inline admin edit form inside a table row */
.feedback-admin-edit { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 0; }
.feedback-admin-edit input[name="title"] { flex: 1 1 220px; }
.feedback-admin-edit input[name="description"] { flex: 2 1 320px; }
.feedback-edit-row { background: rgba(255, 206, 0, .06); }

/* Always-visible version chip in the header */
.topbar-version { display: inline-flex; align-items: center;
  margin-inline-start: 10px; margin-inline-end: auto;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.06); color: var(--muted); white-space: nowrap; line-height: 1.6; }
a.topbar-version:hover { background: rgba(0,0,0,.12); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .topbar-version { background: rgba(255,255,255,.10); }
  a.topbar-version:hover { background: rgba(255,255,255,.18); }
}

/* Integrations & links panel */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; margin-top: 18px; }
.integration-card { display: flex; flex-direction: column; gap: 12px; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit; transition: transform .12s, box-shadow .12s; }
.integration-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.integration-head { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.integration-note-form { display: flex; gap: 8px; }
.integration-note-input { flex: 1 1 auto; min-width: 0; padding: 7px 10px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; }
.integration-note-form .btn { flex: 0 0 auto; }
.integration-icon { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.integration-text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.integration-name { font-weight: 800; }
.integration-desc { font-size: 12px; }
.integration-badge { flex: 0 0 auto; align-self: flex-start; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; }
.intg-ok { background: #e6f7ed; color: #1a7f43; border: 1px solid #b7e6c9; }
.intg-warn { background: #fff4e0; color: #a5670a; border: 1px solid #f2d59a; }
.intg-off { background: #f1f1f3; color: #8a8a94; border: 1px solid var(--line); }

/* Author's own-submissions section on the public feedback board */
.feedback-mine-item { border-inline-start: 3px solid var(--brand); }
.feedback-mine-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.feedback-edit-form { margin-top: 6px; }
.online-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.online-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  font-weight: 600; font-size: 13px; box-shadow: var(--shadow);
}
.honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.inline-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }

/* Status badges */
.status { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.status-ok { background: #e7f7ee; color: var(--ok); }
.status-warn { background: #fff4d9; color: var(--warn); }
.status-bad { background: #fdeaea; color: var(--bad); }
.status-muted { background: var(--bg); color: var(--muted); }

/* Admin */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.admin-side {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); height: fit-content; position: sticky; top: 80px;
}
.admin-side h2 { font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.version-badge {
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; transition: transform .15s;
}
.version-badge:hover { transform: scale(1.06); }
.version-tag {
  background: var(--bg); border: 1px solid var(--line); font-weight: 700;
  padding: 2px 9px; border-radius: 20px; font-size: 13px;
}
.version-nav-btn {
  background: var(--ink); color: #fff !important; border-radius: 20px;
  padding: 7px 14px; font-size: 13px; font-weight: 700;
}
.version-nav-btn:hover { background: #000; transform: translateY(-2px); }
.version-group { margin-bottom: 30px; }
.version-group-heading {
  font-size: 17px; font-weight: 800; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.version-group-heading::before { content: "🏷️"; }
.version-tag-lg { font-size: 16px; padding: 4px 12px; }
.admin-navlink {
  display: block; padding: 10px 12px; border-radius: 8px; font-weight: 600; margin-bottom: 4px;
  transition: background .15s, transform .15s;
}
.admin-navlink:hover { background: var(--bg); transform: translateX(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.admin-navlink.active { background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.admin-main h1 { margin-top: 0; font-weight: 800; }
.admin-main { min-width: 0; overflow-x: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-align: center; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-num { font-size: 34px; font-weight: 900; }
.stat-label { color: var(--muted); margin-top: 4px; }

/* Admin statistics charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap: 16px; margin-top: 20px; }
.export-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.chart-card h3 { margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }

/* Feedback board */
.feedback-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.feedback-item {
  display: flex; gap: 16px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow);
}
.feedback-vote-form { flex-shrink: 0; }
.vote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font-weight: 800; font-size: 15px; cursor: pointer; color: var(--ink);
  transition: background .15s, transform .15s, border-color .15s;
}
.vote-btn:hover { transform: translateY(-2px); border-color: var(--brand-dark); }
.vote-btn.voted { background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: var(--brand-dark); }
.vote-count { font-size: 13px; }
.feedback-body { min-width: 0; }
.feedback-top-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feedback-title { margin: 8px 0 4px; font-size: 16px; }
.feedback-meta { font-size: 12px; margin: 0; font-weight: 600; }
.badge-kind {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; color: #fff;
}
.badge-kind-feature { background: var(--biz); }
.badge-kind-bug { background: var(--bad); }

/* Seller ratings + profile */
.star-rating { font-size: 14px; color: var(--ink); font-weight: 600; }
.star-rating .stars { color: var(--brand-dark); letter-spacing: 1px; }
.seller-profile-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.seller-profile-header h1 { margin: 0; }
.rate-form { max-width: 480px; }
.star-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.star-input {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; color: var(--brand-dark); background: var(--card);
}
.star-input:hover { border-color: var(--brand-dark); }
.star-input input { margin: 0; }
.review-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.review-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow);
}
.review-top-row { display: flex; align-items: center; gap: 10px; }
.review-top-row .stars { color: var(--brand-dark); letter-spacing: 1px; }
.review-author { font-size: 13px; font-weight: 600; }

/* In-app inbox thread */
.msg-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.msg-bubble {
  max-width: 70%; padding: 10px 14px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.msg-bubble-in { align-self: flex-start; }
.msg-bubble-out { align-self: flex-end; background: var(--brand); border-color: var(--brand); }
.msg-bubble-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg-bubble-out .msg-bubble-meta { color: rgba(0,0,0,.55); }
.msg-bubble-body { white-space: pre-wrap; word-break: break-word; }

/* Misc */
.msg-page { text-align: center; padding: 60px 20px; }
.footer { background: var(--card); border-top: 1px solid var(--line); margin-top: 50px; padding: 24px 0; }
.footer p { margin: 4px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
  .hero-blob { animation: none; }
  .reveal-init { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 760px) {
  /* Nav: collapse into a hamburger-triggered dropdown instead of the
     already-cramped flex-wrap row of a dozen links. Login/Register (or the
     avatar badge) stay outside .mainnav so they're always visible.
     .mainnav is positioned absolutely, anchored to .topbar-inner, so it
     always spans the header's full width regardless of how deep it's
     nested inside .topbar-right — nesting it there for "always visible
     auth" broke the old width:100%-of-parent + flex order:3 approach,
     since .topbar-right only sizes itself to its (narrow) visible content. */
  .topbar-inner { position: relative; }
  .nav-toggle { display: flex; }
  .mainnav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px;
    margin-top: 10px; padding: 10px 20px 14px; background: var(--card);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg); z-index: 60;
    /* Long menus (admin links, favorites, feedback, lang switch, ...) can be
       taller than the screen — without this the extra items just overflowed
       off the bottom with no way to reach them, since an absolutely
       positioned box doesn't automatically become page-scrollable. Make the
       dropdown itself scroll (like a normal listings page) instead.
       flex-wrap must stay nowrap here: the desktop rule sets wrap, and
       combined with max-height + flex-direction:column that silently wraps
       overflow items into a second (invisible, overlapping) column instead
       of actually scrolling — which was the real cause of the "menu won't
       scroll" bug, not a missing overflow rule. */
    max-height: calc(100vh - 80px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .mainnav.open { display: flex; }
  .mainnav .nav-link { padding: 12px 10px; }
  .mainnav .lang-switch { margin-inline-start: 0; margin-top: 6px; align-self: flex-start; }
  .mainnav .nav-user { padding: 6px 10px; }

  .container, .container-full { padding: 0 14px; }

  .hero { padding: 34px 18px; border-radius: 16px; }
  .hero h1 { font-size: 23px; margin-bottom: 14px; }
  .hero-search { flex-direction: column; }
  .hero-search button { padding: 12px 16px; }

  .page-h1 { font-size: 22px; }
  .cats h2, .block h2 { font-size: 18px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .card-img { height: 120px; }
  .card-body { padding: 9px; }
  .card-price { font-size: 16px; }
  .card-title { font-size: 13px; }

  .list-toolbar { justify-content: flex-start; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select, .filters button { width: 100%; }

  /* List view table: drop the least essential columns rather than force
     horizontal scrolling on every row of a phone-width table. */
  .listing-table th:nth-child(3), .listing-table td:nth-child(3),
  .listing-table th:nth-child(4), .listing-table td:nth-child(4),
  .listing-table th:nth-child(6), .listing-table td:nth-child(6) {
    display: none;
  }
  .list-table-thumb, .listing-table .list-thumb { width: 52px; height: 40px; }

  .detail { grid-template-columns: 1fr; }
  .detail-main { aspect-ratio: 4/3; }
  .detail-info h1 { font-size: 21px; }
  .detail-price { font-size: 24px; }
  .detail-meta { gap: 8px; font-size: 13px; }
  .owner-actions, .contact-form { width: 100%; }

  .bigform, .auth-box form { padding: 16px; }
  .bigform .row { gap: 10px; }
  .bigform .row label { min-width: 100%; }
  .color-row { flex-direction: row; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 24px; }

  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side { position: static; }

  .msg-bubble { max-width: 88%; }

  .lightbox-close { top: 10px; inset-inline-end: 10px; width: 36px; height: 36px; font-size: 20px; }

  .pagination { gap: 10px; }

  .footer { padding: 18px 0; }
  .footer p { font-size: 13px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-price { font-size: 21px; }
}

/* --- Admin: Share / QR panel --------------------------------------------- */
.field-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 400; }
.share-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.share-card {
  margin-top: 20px; padding: 32px; border: 1px solid var(--line); border-radius: 16px;
  background: #fff; display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.share-qr { flex: 0 0 auto; }
.share-qr img { display: block; width: 320px; height: 320px; max-width: 100%; }
.share-link-block { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.share-link-label { font-size: 15px; color: var(--muted); }
.share-link { font-size: 26px; font-weight: 800; color: var(--ink); text-decoration: none; word-break: break-all; }
.share-link:hover { text-decoration: underline; }
.share-scan-hint { font-size: 14px; color: var(--muted); }

@media print {
  .topbar, .footer, .admin-side, .no-print, .version-badge { display: none !important; }
  .admin-wrap { display: block; }
  .admin-main { padding: 0; }
  .share-card { border: none; box-shadow: none; margin: 0; justify-content: center; text-align: center; }
  body { background: #fff; }
}

/* --- Admin: collapsible advanced settings block -------------------------- */
.settings-advanced { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--bg); }
.settings-advanced > summary { cursor: pointer; padding: 12px 4px; list-style: none;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.settings-advanced > summary::-webkit-details-marker { display: none; }
.settings-advanced > summary::before { content: "▸"; color: var(--muted); font-size: 13px; }
.settings-advanced[open] > summary::before { content: "▾"; }
.settings-advanced-title { font-weight: 800; }
.settings-advanced-hint { font-size: 12px; }
.settings-advanced[open] { padding-bottom: 14px; }

/* --- Admin-uploaded branding --------------------------------------------- */
/* Show the whole logo — never crop it. Cap by height AND width so it scales
   down cleanly on phones while keeping its natural aspect ratio. */
.logo-img { display: block; width: auto; height: auto;
  max-height: 62px; max-width: min(430px, 70vw);
  object-fit: contain; border-radius: 12px; box-shadow: 0 2px 8px rgba(20,20,50,.12); }
.footer-badge-link { display: block; text-align: center; }
.footer-badge { display: block; width: 195px; height: 195px; max-width: 66vw;
  object-fit: contain; margin: 0 auto 12px; }
@media (max-width: 600px) {
  .logo-img { max-height: 50px; max-width: 62vw; }
  .footer-badge { width: 166px; height: 166px; }
}

.brand-uploaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-bottom: 20px; }
.brand-uploader { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg); }
.brand-uploader .form-subheading { margin-top: 0; }
.brand-preview { display: flex; align-items: center; justify-content: center; min-height: 120px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--card); padding: 12px; margin: 10px 0; }
.brand-preview img { max-width: 100%; max-height: 200px; object-fit: contain; }
.brand-preview.brand-empty { color: var(--muted); font-size: 13px; }
.brand-placeholder { color: var(--muted); font-size: 13px; }
.brand-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Terms/Privacy links on the registration consent line — clearly clickable. */
.legal-link { color: var(--biz); font-weight: 800; text-decoration: underline; }
.legal-link:hover { color: var(--brand-dark); }

/* Per-field validation errors on forms — highlight only the wrong field. */
label.has-error { color: var(--bad); }
label.has-error input, label.has-error select, label.has-error textarea {
  border-color: var(--bad); background: #fff6f6; }
.field-err-msg { display: block; color: var(--bad); font-size: 13px; font-weight: 600; margin-top: 4px; }

/* Manage Users — presence dots, legend, search/filter bar. */
.user-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.user-legend span { white-space: nowrap; }
.presence-dot { font-size: 11px; }
.user-search-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.user-search-bar input[type="search"] { flex: 1 1 240px; min-width: 160px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.user-search-bar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); font-size: 14px; }
