/* ==========================================================================
   Poppins, self-hosted.
   Served from this origin instead of fonts.googleapis.com: that was a
   render-blocking stylesheet on a third-party host, costing a DNS lookup and a
   TLS handshake before a single glyph could be requested — and telling Google
   about every visitor. The files come from the same Google Fonts build, split
   the same way; `unicode-range` means a browser only fetches the subsets the
   page actually needs.

   Poppins has no Cyrillic, so Russian falls through to the stack in `--font`.
   That was already true when the font came from Google; it is written down here
   because it is a design decision, not an accident.
   ========================================================================== */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/public/fonts/poppins-latin-ext-800.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   tezsat web — design system
   Poppins, #0D7FF2 blue with a #6F52EA purple accent, soft cards on a
   near-white canvas. Aligned with the mobile app's visual language.
   ========================================================================== */

:root {
  --brand: #0d7ff2;
  --brand-dark: #094a8c;
  --brand-deep: #0058a1;
  --brand-soft: #f0f7ff;
  --accent: #6f52ea;

  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #141414;
  --text-soft: #4b5563;
  --muted: #6b7280;
  --border: #e6eaf1;

  --danger: #e5484d;
  --success: #18a058;
  --warning: #f5a524;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(13, 38, 76, 0.06), 0 1px 6px rgba(13, 38, 76, 0.05);
  --shadow: 0 4px 16px rgba(13, 38, 76, 0.08), 0 1px 3px rgba(13, 38, 76, 0.05);
  --shadow-lg: 0 16px 48px rgba(13, 38, 76, 0.14);

  --grad-brand: linear-gradient(135deg, #0d7ff2 0%, #4a6cf0 55%, #6f52ea 100%);

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── Reset & base ─────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.15rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem); }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }
p { margin: 0 0 1em; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; color: inherit; }

:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 520px; margin-inline: auto; }
.narrow-wide { max-width: 760px; margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.75rem; }
.lead { font-size: 1.05rem; color: var(--text-soft); }
.hint { font-size: 0.85rem; color: var(--muted); background: var(--brand-soft); padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); }
.icon { flex: none; vertical-align: -0.15em; }

/* "Do this in the app" card. Both stores are always listed — the choice is
   never made from the User-Agent — so the row has to hold two buttons at any
   width. */
.app-cta {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.app-cta__title { display: block; margin-bottom: 0.25rem; font-size: 1.02rem; color: var(--brand-deep); }
.app-cta p { margin: 0 0 0.9rem; font-size: 0.9rem; line-height: 1.5; }
.app-cta__stores { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.app-cta__stores .btn { flex: 1 1 180px; text-align: center; }
/* The live next-bid figure. Sits between the CTA copy and the store buttons,
   so it reads as the reason to get the app rather than as a field to fill in.
   Hidden until the socket supplies a number — the server cannot. */
.app-cta__note {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-deep);
}
.app-cta__note[hidden] { display: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 200;
}
.skip-link:focus { left: 0; color: #fff; }

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.35rem;
  border-radius: var(--pill);
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(13, 127, 242, 0.32); }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 24px rgba(13, 127, 242, 0.42); transform: translateY(-1px); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-sm { padding: 0.42rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.9rem; font-size: 1rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.link-button { background: none; border: none; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.link-button.danger, .danger { color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--pill);
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.badge-boost { background: linear-gradient(135deg, #ffb020, #f5a524); color: #3a2500; }
.badge-live { background: rgba(24, 160, 88, 0.14); color: var(--success); }
.badge-upcoming { background: rgba(245, 165, 36, 0.16); color: #8a5a00; }
.badge-muted { background: #eef1f6; color: var(--muted); }
/* Item held at the Tezsat warehouse — buyers can come and inspect it. */
.badge-warehouse { background: var(--brand-soft); color: var(--brand-deep); }
.badge-premium-seller {
  grid-area: 2 / 2;
  justify-self: end;
  width: 20px;
  height: 20px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: #fcefd6;
  color: #9a6400;
}
.badge-premium-seller .icon { flex-shrink: 0; }
/* Reserve state. Amber for "not there yet" rather than red: an unmet reserve
   is information about the auction, not a failure by the person reading it. */
.badge-reserve { background: rgba(245, 165, 36, 0.16); color: #8a5a00; }
.badge-reserve-met { background: rgba(24, 160, 88, 0.14); color: var(--success); }

/* ── Header ───────────────────────────────────────────── */

.mobile-tabs { display: none; }

.site-header {
  position: relative;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; gap: 0.8rem; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; flex: none; }
.brand-logo { height: 30px; width: auto; }
.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 220px;
  max-width: 340px;
  min-width: 0;
  padding: 0.4rem 0.9rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--pill);
  color: var(--muted);
  margin: 0;
}
.nav-search:focus-within { border-color: var(--brand); background: #fff; }
.nav-search input { flex: 1; border: none; background: none; color: var(--text); outline: none; font-size: 0.9rem; min-width: 0; }
.nav-search input::placeholder { color: var(--muted); opacity: 1; }

.market-menu { position: relative; flex: none; }
.market-menu > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
}
.market-menu > summary:hover, .market-menu[open] > summary { background: var(--brand-soft); color: var(--brand-deep); }
.market-menu > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.market-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 70;
  width: min(300px, calc(100vw - 2rem));
  max-height: calc(100dvh - var(--mobile-tabs-offset, 0px) - 5rem);
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.market-menu__panel a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 46px;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.9rem;
}
.market-menu__panel a:hover, .market-menu__panel a.active { color: var(--brand-deep); background: var(--brand-soft); }
.market-menu__panel a.active { font-weight: 600; }
.market-menu__panel a:last-child { margin-top: 0.5rem; border-top: 1px solid var(--border); }

.nav-actions { display: flex; align-items: center; gap: 0.55rem; margin-left: auto; }

.nav-icons { display: flex; align-items: center; gap: 0.2rem; }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-soft);
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn.active { background: var(--brand-soft); color: var(--brand); }
.icon-btn .nav-badge { position: absolute; top: 2px; right: 0; }

details.lang-menu, details.user-menu { position: relative; }
details.lang-menu summary, details.user-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 600;
  font-size: 0.85rem;
}
details summary::-webkit-details-marker { display: none; }
details[open] summary { border-color: var(--brand); color: var(--brand); }
.lang-caret { font-size: 0.65rem; color: var(--muted); }

.lang-panel, .user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  z-index: 70;
}
.lang-panel a, .user-menu-panel a, .user-menu-panel .link-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
}
.lang-panel a:hover, .user-menu-panel a:hover { background: var(--brand-soft); color: var(--brand); }
.lang-panel a.active { color: var(--brand); font-weight: 700; }
.lang-panel .lang-code { font-weight: 700; font-size: 0.8rem; min-width: 24px; }
.lang-panel .lang-name { color: var(--muted); font-size: 0.85rem; }
.user-menu-panel hr { border: none; border-top: 1px solid var(--border); margin: 0.35rem 0; }
.user-menu-panel form { display: contents; }

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  flex: none;
}
.avatar-fallback.lg { width: 44px; height: 44px; font-size: 1.05rem; }
.avatar-fallback.xl { width: 72px; height: 72px; font-size: 1.7rem; }
.user-menu summary img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Flash ────────────────────────────────────────────── */

.flash-wrap { display: grid; gap: 0.5rem; margin-top: 1rem; }
.flash { padding: 0.75rem 1.1rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; }
.flash ul { margin: 0; padding-left: 1.1rem; }
.flash-error { background: #fdeced; color: #a4262c; }
.flash-info { background: var(--brand-soft); color: var(--brand-deep); }
.flash-success { background: #e7f7ee; color: #10693b; }

/* ── Search box (404 page) ────────────────────────────── */


.hero-search { display: flex; gap: 0.5rem; margin: 0.9rem 0 1rem; max-width: 540px; }
.hero-search input {
  flex: 1;
  padding: 0.62rem 1rem;
  border-radius: var(--pill);
  border: none;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  outline: none;
  min-width: 0;
}
.hero-search input::placeholder { color: var(--muted); opacity: 1; }
.hero-search .btn { padding: 0.55rem 1.1rem; }
.hero-search .btn-primary { background: #0c1626; box-shadow: none; }
.hero-search .btn-primary:hover { background: #16233a; }


/* ── Sections ─────────────────────────────────────────── */

.page { padding: 1.8rem 0 3rem; }
.section { margin-top: 2.6rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.section-head h2 { margin: 0; }
.section-link { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; font-size: 0.9rem; }

.archive-head { margin-bottom: 1.4rem; }
.archive-head h1 { margin-bottom: 0.25rem; }
.archive-head .btn { margin-top: 0.8rem; }
.archive-intro { max-width: 70ch; color: var(--text-soft); }

.cta-band {
  margin-top: 2.6rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  border: 1px solid #d7e8fb;
  text-align: center;
}
.cta-band h2 { margin-bottom: 0.35rem; }

/* ── Breadcrumbs ──────────────────────────────────────── */

.breadcrumbs { margin-bottom: 1rem; font-size: 0.82rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }
.crumb-sep { color: #c3cbd8; }

/* ── Listing cards ────────────────────────────────────── */

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
}

.ending-auctions-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 220px);
  gap: 1.1rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  padding: 0.2rem 0 0.8rem;
}
.ending-auctions-head { align-items: center; flex-wrap: wrap; }
.ending-auctions-head h2 { flex: 1 1 200px; }
.rail-controls { display: flex; gap: 0.45rem; margin-left: auto; }
.rail-controls[hidden] { display: none; }
.rail-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-deep);
  cursor: pointer;
}
.rail-arrow:not(:disabled):hover { border-color: var(--brand); background: var(--brand-soft); }
.rail-arrow:disabled { opacity: 0.4; cursor: default; }
.rail-arrow--prev .icon { transform: rotate(180deg); }
.ending-auctions-rail .listing-card { scroll-snap-align: start; border-color: #f4d59b; }
/* "Your categories" borrows the rail's layout, not its auction-amber cards. */
.ending-auctions-rail.starred-rail .listing-card { border-color: var(--border); }
.auction-card-end {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  max-width: calc(100% - 0.8rem);
  padding: 0.2rem 0.45rem;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand-deep);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-sm);
}
.has-auction-time .card-tags { top: 0.4rem; bottom: auto; left: 0.4rem; right: 3rem; }
.has-auction-time .card-tags .badge { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.has-auction-time .card-media .badge-boost { top: auto; bottom: 0.4rem; }
.has-auction-time.is-boosted .auction-card-end { max-width: calc(100% - 3rem); }
.auction-card-winner { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.home-load-more {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 0.8rem 1.2rem;
  color: var(--brand-deep);
  font-weight: 600;
}

.listing-card {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d7e0ec; }
.listing-card.is-boosted { border-color: #ffd58a; }

.card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: #eef1f6; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.listing-card:hover .card-media img { transform: scale(1.045); }
.card-media .badge-boost { position: absolute; left: 0.6rem; top: 0.6rem; }
.card-tags { position: absolute; left: 0.6rem; bottom: 0.6rem; display: flex; gap: 0.3rem; }
.card-tags .badge { background: rgba(12, 22, 38, 0.72); color: #fff; backdrop-filter: blur(4px); }
.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}

.card-body { padding: 0.75rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card-title { font-size: 0.93rem; font-weight: 600; margin: 0; line-height: 1.35; }
/* Two lines' worth of space whether the title needs it or not, so the price
   sits on the same baseline across a row of cards. */
.card-title a {
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.card-title a:hover { color: var(--brand); }
.card-price { font-weight: 700; color: var(--brand-deep); font-size: 1rem; margin-top: auto; }
/* Reserve a column for views; city and date must never push the count out. */
.card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.15rem 0.45rem;
  font-size: 0.76rem;
  color: var(--muted);
  min-height: 2.9em;
}
.card-location { grid-area: 1 / 1; display: flex; align-items: center; gap: 0.2rem; min-width: 0; }
.card-location-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-time { grid-area: 2 / 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-views { grid-area: 1 / 2; display: inline-flex; align-items: center; gap: 0.2rem; white-space: nowrap; }

.fav-btn {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.15s, transform 0.15s;
}
.fav-btn:hover { color: var(--danger); transform: scale(1.08); }
.fav-btn.is-on { color: var(--danger); }
.fav-inline.is-on { border-color: var(--danger); color: var(--danger); }

/* ── Chips & categories ───────────────────────────────── */

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.chip-row.tiny .chip { font-size: 0.72rem; padding: 0.2rem 0.6rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 500;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); font-weight: 600; }
.chip-count { color: var(--muted); font-size: 0.72rem; }

.category-carousel-wrap { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem; }
.category-carousel {
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin: 0;
  padding: 0.2rem 0;
}
.category-carousel::-webkit-scrollbar { display: none; }
.category-carousel .chip { flex: none; min-height: 44px; white-space: nowrap; scroll-snap-align: start; }


.category-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.6rem; }
.category-column h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.category-column ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.category-column a { color: var(--text-soft); font-size: 0.88rem; }
.category-column a:hover { color: var(--brand); }

/* ── Filters & pagination ─────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
}
.filter-bar input, .filter-bar select {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.5rem 0.85rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  background: var(--bg);
  outline: none;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--brand); background: #fff; }
.filter-bar .filter-check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--text-soft); white-space: nowrap; }
.filter-bar .filter-check input { flex: none; width: auto; padding: 0; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin-top: 2rem; }
.page-link {
  min-width: 38px;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
}
.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-gap { padding: 0.4rem 0.3rem; color: var(--muted); }

/* ── Empty states ─────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state h2 { font-size: 1.1rem; }
.empty-state .btn { margin-top: 0.8rem; }

/* ── Listing / auction detail ─────────────────────────── */

.listing-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: start; }

.detail-gallery { position: sticky; top: 88px; }
.gallery-main {
  width: 100%;
  /* The `height` attribute on the <img> is a presentational hint, which makes
     the box definite and `aspect-ratio` inert — the photo rendered at its
     attribute height instead of 4:3. `height: auto` gives the ratio control. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: #eef1f6;
  border: 1px solid var(--border);
}
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; overflow-x: auto; padding-bottom: 0.2rem; }
.gallery-thumbs img {
  width: 84px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: none;
}

.detail-main h1 { margin-bottom: 0.4rem; }
.detail-price {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin-bottom: 0.8rem;
}
/* "Current bid" / "Starting" ahead of an auction's number. Sized off the
   surrounding text rather than the price, which is 1.65rem and would shout it. */
.detail-price__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.detail-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 1.1rem; margin: 0 0 1.2rem; padding: 0; color: var(--muted); font-size: 0.85rem; }
.detail-meta li { display: inline-flex; align-items: center; gap: 0.3rem; }
/* "Elan № 104523": reads as the other meta items, copies on click (app.js). */
.detail-number { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: copy; user-select: all; }
.detail-number:hover, .detail-number.is-done { color: var(--text); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }

.seller-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.seller-card:has(.seller-link[href]:hover) { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.seller-link { display: flex; align-items: center; gap: 0.75rem; color: var(--text); }
.seller-link img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
/* Scoped to the text column by class. `.seller-link span` also matched the
   avatar fallback and — once a store carried one — the verified mark, which
   `flex-direction: column` then dropped onto a line of its own under the name. */
.seller-link__body { display: flex; flex-direction: column; min-width: 0; }
.seller-link__name { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.seller-link__name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-link__go { margin-left: auto; color: var(--muted); flex: none; }
.seller-link[href]:hover strong { color: var(--brand); }
.seller-link[href]:hover .seller-link__go { color: var(--brand); }

.detail-section { margin-top: 2.4rem; }
.detail-description { white-space: pre-wrap; max-width: 75ch; color: var(--text-soft); }

.spec-list {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 0.1rem 1rem;
  margin: 0;
  max-width: 640px;
}
.spec-list dt { padding: 0.5rem 0; color: var(--muted); font-size: 0.85rem; text-transform: capitalize; border-bottom: 1px solid var(--border); }
.spec-list dd { padding: 0.5rem 0; margin: 0; font-weight: 500; border-bottom: 1px solid var(--border); }

/* A car's extras: icon chips under the spec table. */
.extras { margin-top: 1.6rem; max-width: 640px; }
.extras h3 { margin-bottom: 0.7rem; }
.extras__list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.extras__item { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.85rem; border-radius: var(--pill); background: var(--brand-soft); color: var(--text); font-size: 0.88rem; font-weight: 500; }
.extras__item .icon { flex: none; color: var(--brand); }

/* auctions */
.auction-panel > .badge { margin: 0 0.4rem 0.8rem 0; }
.auction-price { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 1rem; }
.auction-price strong { font-size: 1.9rem; font-weight: 800; color: var(--brand-deep); line-height: 1.1; }
/* Participant count — socket-only, so it ships hidden and appears on connect. */
.auction-participants { margin: -0.5rem 0 1rem; }
.auction-participants[hidden] { display: none; }

.bid-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-bottom: 1rem; }
.bid-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.bid-form input {
  padding: 0.6rem 1rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  outline: none;
  min-width: 160px;
}
.bid-form input:focus { border-color: var(--brand); }

.bid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; max-width: 520px; }
.bid-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.bid-list li.is-new { animation: bid-flash 1.2s ease; }
@keyframes bid-flash { from { background: #e7f7ee; } to { background: var(--surface); } }

.auction-list { display: grid; gap: 0.7rem; }
.auction-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.auction-row:hover { border-color: var(--brand); }
.auction-row img { width: 84px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.auction-row span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.auction-row small { display: inline-flex; align-items: center; gap: 0.25rem; }
.auction-row .badge { align-self: flex-start; }

/* ── Forms ────────────────────────────────────────────── */

.stack-form { display: grid; gap: 1rem; max-width: 640px; margin-top: 1.2rem; }
.stack-form label { display: grid; gap: 0.35rem; font-size: 0.88rem; font-weight: 600; }
.stack-form label > span { color: var(--text-soft); }
.stack-form input[type="text"],
.stack-form input[type="email"],
.stack-form input[type="number"],
.stack-form input[type="search"],
.stack-form input[type="file"],
.stack-form select,
.stack-form textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  outline: none;
  font-weight: 400;
}
.stack-form textarea { resize: vertical; }
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 127, 242, 0.12); }
.stack-form small { font-weight: 400; }
.stack-form .btn { justify-self: start; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; }

label.checkbox { display: flex; flex-direction: row; align-items: flex-start; gap: 0.6rem; font-weight: 400; }
label.checkbox input { width: auto; margin-top: 0.25rem; }


/* ── Profile ──────────────────────────────────────────── */

.profile-head { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.profile-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.profile-head h1 { margin: 0 0 0.15rem; }
.profile-head p { margin: 0; }
.profile-head > .btn { margin-left: auto; }

.my-listing-list { display: grid; gap: 0.5rem; }
.my-listing-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.my-listing-row > a { flex: 1; font-weight: 600; color: var(--text); }
.my-listing-row > a:hover { color: var(--brand); }
.status { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: var(--pill); background: #eef1f6; color: var(--muted); }
.status-active { background: #e7f7ee; color: var(--success); }
.status-pending { background: #fff4e0; color: #a2650a; }
.status-sold, .status-expired { background: #fdeced; color: var(--danger); }

/* ── Chat ─────────────────────────────────────────────── */

.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.chat-list a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.chat-list a:hover { border-color: var(--brand); }
.chat-list img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.chat-row { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-page { display: flex; flex-direction: column; min-height: 60vh; }
.chat-head { display: flex; align-items: center; gap: 0.8rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.back-link { font-size: 0.85rem; color: var(--muted); }

.message-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.message-list li { max-width: min(72%, 520px); padding: 0.6rem 0.9rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.message-list li p { margin: 0; white-space: pre-wrap; }
.message-list li time { font-size: 0.7rem; color: var(--muted); }
.message-list li.mine { align-self: flex-end; background: var(--brand-soft); border-color: #cfe4fb; }
.message-list li.mine.error { background: #fdeced; border-color: #f3c6c8; }
/* Where an earlier support conversation ended. */
.message-list li.thread-closed { align-self: stretch; max-width: none; display: flex; align-items: center; gap: 0.75rem; margin: 0.6rem 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: center; }
.message-list li.thread-closed::before, .message-list li.thread-closed::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.chat-compose { display: flex; gap: 0.6rem; position: sticky; bottom: 0; padding: 0.8rem 0; background: var(--bg); }
.chat-compose input {
  flex: 1;
  padding: 0.7rem 1.1rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  outline: none;
  min-width: 0;
}
.chat-compose input:focus { border-color: var(--brand); }

/* ── Blog ─────────────────────────────────────────────── */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1.4rem; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.post-card h3 { margin: 0; font-size: 1rem; color: var(--text); }
.post-card a:hover h3 { color: var(--brand); }
.post-card p { margin: 0; font-size: 0.88rem; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: auto; }

.post { max-width: 72ch; margin-inline: auto; }
.post-head { margin-bottom: 1.6rem; }
.post-head h1 { margin-bottom: 0.4rem; }
.post-cover { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); margin-top: 1.2rem; }
.post-foot { margin-top: 2rem; }

/* Markdown output. Constrained measure and generous rhythm — a blog post is
   read top to bottom, unlike the scannable listing pages. */
.prose { font-size: 1.02rem; line-height: 1.75; color: var(--text-soft); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; color: var(--text); font-size: 1.35rem; }
.prose h3 { margin-top: 1.6em; color: var(--text); font-size: 1.1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4em; }
.prose img { border-radius: var(--radius); margin-inline: auto; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--brand);
  color: var(--text);
  font-style: italic;
}
.prose code {
  background: #eef1f6;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.prose pre { background: #0c1626; color: #dfe7f1; padding: 1rem 1.2rem; border-radius: var(--radius); overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; }
.prose th { background: var(--bg); }
.prose hr { border: none; border-top: 1px solid var(--border); }

.prose-page { max-width: 78ch; }
.prose-page section { margin-bottom: 1.6rem; }
.prose-page h2 { font-size: 1.15rem; margin-top: 1.6rem; }
.prose-page ul { padding-left: 1.3rem; color: var(--text-soft); }

/* ── FAQ ──────────────────────────────────────────────── */

.faq { display: grid; gap: 0.6rem; max-width: 78ch; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0.7rem 0 0; color: var(--text-soft); }

/* The contact block on /about. A plain list, because every row is a label and
   a link and a two-column table would be four rows of mostly whitespace. */
.contact-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.5rem; max-width: 78ch; }
.contact-list li { color: var(--text-soft); }
.contact-list a { font-weight: 600; }

/* ── Footer ───────────────────────────────────────────── */

.site-footer { background: #0c1626; color: #c4cfdd; padding: 3.2rem 0 1.4rem; margin-top: 3rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-brand .brand-name { background: none; -webkit-background-clip: initial; background-clip: initial; color: #fff; }
.footer-brand .muted { color: #8fa0b5; margin: 0.7rem 0 1rem; }
.footer-col h4 { color: #fff; margin-bottom: 0.9rem; font-size: 0.92rem; letter-spacing: 0.02em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-col a { color: #aebccd; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
/* A phone number broken across two lines stops being one number. The footer
   collapses to fewer, wider columns well before this could overflow. */
.footer-col a[href^="tel:"] { white-space: nowrap; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 1.3rem;
  font-size: 0.82rem;
  color: #8fa0b5;
}
.footer-bottom .muted { color: #6c7d92; }

/* store badges */
.store-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.4rem; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1.1rem;
  border-radius: 12px;
  line-height: 1.15;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.store-btn-dark { background: #101418; color: #fff; border: 1px solid #2a3138; }
.store-btn-dark:hover { color: #fff; }
.store-btn-light { background: #fff; color: #101418; border: 1px solid var(--border); }
.store-btn-light:hover { color: #101418; }
.store-icon { width: 22px; height: 22px; flex: none; }
.store-text { display: flex; flex-direction: column; text-align: left; }
.store-sup { font-size: 0.62rem; letter-spacing: 0.04em; opacity: 0.75; text-transform: uppercase; }
.store-name { font-size: 0.98rem; font-weight: 700; }

/* ── htmx ─────────────────────────────────────────────── */

/* Any element htmx is waiting on dims slightly, so a slow swap still reads as
   "working" without needing a spinner per control.
   These also stand in for the stylesheet htmx would inject at startup — see the
   `htmx-config` meta tag, which turns that injection off so `style-src` can
   stay at 'self'. */
.htmx-indicator { opacity: 0; transition: opacity 0.2s ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request, .htmx-request.htmx-indicator { opacity: 0.55; pointer-events: none; }

/* ── Responsive ───────────────────────────────────────── */

/* The container caps content at 1180px, so the account pill starts to overflow
   well before the viewport gets narrow. The name is the first thing to go — the
   avatar still identifies who is signed in. */
@media (max-width: 1320px) {
  .user-name { display: none; }
}

@media (max-width: 1160px) {
  .nav-actions .btn-primary span.btn-label { display: none; }
  .nav-actions .btn-primary { padding: 0.42rem 0.8rem; }
}

@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .nav-search { max-width: 220px; }
}

@media (max-width: 960px) {
  .listing-detail { grid-template-columns: 1fr; }
  .detail-gallery { position: static; }
}

@media (max-width: 760px) {
  .nav-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    height: auto;
    padding: 0.5rem 0;
    gap: 0.4rem;
  }
  .nav-wrap > .brand { grid-area: 1 / 1; gap: 0.35rem; }
  .nav-wrap .brand-logo { height: 26px; }
  .nav-wrap .brand-name { font-size: 1.15rem; }
  /* Place account controls independently so signed-in icons can share the
     navigation row instead of squeezing the brand out of the first row. */
  .nav-actions { display: contents; }
  .nav-actions .lang-menu { grid-area: 1 / 2; }
  .nav-sign-in, .nav-post { grid-area: 1 / 3; }
  .nav-sign-up, .nav-actions .user-menu { grid-area: 1 / 4; }
  .nav-actions .btn { min-height: 44px; padding: 0.4rem 0.65rem; }
  .nav-actions details summary { min-height: 44px; padding: 0.35rem 0.6rem; }
  .nav-actions .user-menu summary { padding: 0.35rem; }
  .nav-actions .user-menu { justify-self: end; }
  .nav-actions .nav-post { min-width: 44px; padding: 0.4rem; justify-self: center; }
  .nav-actions .nav-post .btn-label { display: none; }
  .lang-panel, .user-menu-panel { max-width: calc(100vw - 1.6rem); max-height: calc(100dvh - 4.5rem); overflow-y: auto; }
  .nav-wrap.is-signed-in .lang-panel { left: 0; right: auto; }
  .lang-panel a, .user-menu-panel a, .user-menu-panel .link-button { min-height: 44px; }
  .nav-icons { grid-area: 3 / 3 / 4 / -1; justify-content: flex-end; gap: 0.15rem; }
  .nav-icons .icon-btn { width: 44px; height: 44px; }
  /* A four-level trail wraps to two lines and pushes the photo below the fold.
     The parent category and the current page are the two that earn their space;
     the rest stay in the JSON-LD for crawlers. */
  .breadcrumbs li:not(:nth-last-child(-n + 2)) { display: none; }
  .breadcrumbs li:nth-last-child(2) .crumb-sep { display: inline-flex; }
  .nav-search { grid-area: 2 / 1 / 3 / -1; max-width: none; min-width: 0; min-height: 44px; padding: 0.4rem 0.75rem; }
  .nav-search input { font-size: 1rem; }
  .user-name { display: none; }
  .section { margin-top: 1.8rem; }
  .section-head { gap: 0.6rem; margin-bottom: 0.85rem; }
  .section-head h2 { min-width: 0; overflow-wrap: anywhere; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col { min-width: 0; overflow-wrap: anywhere; }
  .listing-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 0.8rem; }
  .faq-item summary { display: flex; justify-content: space-between; gap: 0.75rem; }
  .faq-item summary::after { flex: none; }
  .spec-list { grid-template-columns: 1fr; }
  .spec-list dt { border-bottom: none; padding-bottom: 0; }
  .profile-head > .btn { margin-left: 0; }
}

@media (max-width: 520px) {
  .container { width: min(1180px, 100% - 1.6rem); }
  .nav-sign-up { display: none; }
  .nav-sign-in { grid-column: 3 / -1; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .card-body { padding: 0.6rem; }
  .card-title { font-size: 0.84rem; overflow-wrap: anywhere; }
  .card-price { font-size: 0.95rem; overflow-wrap: anywhere; }
  .card-meta { column-gap: 0.35rem; font-size: 0.7rem; }
  .card-media .badge-boost { left: 0.4rem; top: 0.4rem; max-width: calc(100% - 0.8rem); }
  .card-tags { left: 0.4rem; right: 0.4rem; bottom: 0.4rem; flex-wrap: wrap; }
  .card-media .badge { font-size: 0.66rem; padding: 0.2rem 0.45rem; }
  .ending-auctions-rail { grid-auto-columns: 72%; gap: 0.75rem; }
  .ending-auctions-head { flex-wrap: nowrap; }
  .ending-auctions-head h2 { flex: 1; }
  .rail-arrow { width: 44px; height: 44px; }
  .footer-grid { gap: 1.4rem 1rem; }
  .site-footer { padding-top: 2rem; margin-top: 2rem; }
  .message-list li { max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}


/* ── Notifications ────────────────────────────────────── */

.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--pill);
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.nav-badge[hidden] { display: none; }

.notification-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.notification-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.notification-list li.is-unread { border-color: #bcd9f8; background: var(--brand-soft); }
.notification-list a,
.notification-list .notification-static {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text);
}
.notification-list a:hover { color: var(--brand); }
.notification-row { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.notification-list time { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

.archive-head.with-action { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ☆ beside a category page's heading — "Your categories" */
.archive-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.archive-title h1 { margin-bottom: 0; }
.cat-star { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cat-star-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.cat-star-btn:hover { color: var(--warning); border-color: var(--warning); transform: scale(1.06); }
.cat-star-btn.is-on { color: var(--warning); border-color: var(--warning); }
.cat-star-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cat-star-note { font-size: 0.85rem; color: var(--danger); }

/* ── Account ──────────────────────────────────────────── */

.avatar-field { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.avatar-field img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.avatar-field label { flex: 1; min-width: 200px; }

.readonly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.readonly-row div { display: flex; flex-direction: column; }

.danger-zone {
  padding: 1.2rem;
  border: 1px solid #f3c6c8;
  border-radius: var(--radius);
  background: #fffafa;
}
.danger-zone .section-head h2 { color: var(--danger); font-size: 1.05rem; }
.btn-ghost.danger { border-color: #f3c6c8; color: var(--danger); }
.btn-ghost.danger:hover { border-color: var(--danger); background: #fdeced; color: var(--danger); }

.profile-actions { display: flex; gap: 0.5rem; margin-left: auto; flex-wrap: wrap; }

/* ── Sessions ─────────────────────────────────────────── */

.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.session-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.session-list li.is-current { border-color: var(--brand); background: var(--brand-soft); }
.session-row { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* ── Wallet ───────────────────────────────────────────── */

.wallet-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wallet-card strong { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.wallet-card.is-primary { background: var(--grad-brand); border-color: transparent; color: #fff; }
.wallet-card.is-primary strong, .wallet-card.is-primary .muted { color: #fff; }

/* ── Listing management ───────────────────────────────── */

.owner-actions {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
}
.owner-actions.is-first { border-style: solid; border-color: #cfe4fb; background: var(--brand-soft); }
.owner-actions.is-first .btn-ghost { background: #fff; }
.owner-actions .detail-actions { margin: 0.5rem 0 0; }

.quote-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.2rem;
  margin: 1.2rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.quote-card strong { font-size: 1.6rem; font-weight: 800; color: var(--brand-deep); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feature-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.feature-card h3 { margin: 0; font-size: 1rem; }
.feature-card p { margin: 0; font-size: 0.85rem; }
.feature-price { font-size: 1.25rem; font-weight: 800; color: var(--brand-deep); margin-top: auto; }
.feature-card .btn { margin-top: 0.5rem; align-self: flex-start; }


.my-listing-row .row-title { flex: 1; }
.row-actions { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
/* The delete control is a form; without this it sits a line higher than the
   plain links beside it. */
.row-actions form { display: flex; align-items: center; }
.row-actions a, .row-actions .link-button { font-size: 0.85rem; font-weight: 600; line-height: 1.4; }

/* ── Phone reveal & report ────────────────────────────── */

.phone-reveal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 1.35rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--success);
  background: #e7f7ee;
  color: #10693b;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.phone-reveal:hover { color: #0b4f2c; }
.phone-reveal.is-empty {
  border-color: var(--border);
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.report-link { margin-top: 2rem; font-size: 0.85rem; }
.report-link a { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); }
.report-link a:hover { color: var(--danger); }

/* ── Payment result ───────────────────────────────────── */

.payment-result {
  padding: 2.4rem 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.payment-result.is-paid { border-color: #b6e6cb; background: #f4fcf7; }
.payment-result.is-failed { border-color: #f3c6c8; background: #fffafa; }
.payment-amount { font-size: 1.8rem; font-weight: 800; color: var(--brand-deep); margin: 0.4rem 0 1rem; }
.detail-actions.center-actions { justify-content: center; }

/* ── Active filters ───────────────────────────────────── */

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: -0.6rem 0 1.2rem; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--pill);
  background: var(--brand-soft);
  border: 1.5px solid #cfe4fb;
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 600;
}
.filter-chip:hover { border-color: var(--danger); background: #fdeced; color: var(--danger); }
.filter-chip span[aria-hidden] { font-size: 1rem; line-height: 1; opacity: 0.7; }
.filter-clear { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.filter-clear:hover { color: var(--danger); }

/* Visible to screen readers only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Gallery ──────────────────────────────────────────── */

.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; overflow-x: auto; padding: 0.15rem 0.15rem 0.35rem; }
.gallery-thumb {
  flex: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  outline-offset: 2px;
  transition: border-color 0.15s ease, opacity 0.15s ease;
  opacity: 0.72;
}
.gallery-thumb img { width: 84px; height: 64px; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.is-active { border-color: var(--brand); opacity: 1; }

/* ── Share ────────────────────────────────────────────── */

.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 1rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); }
.share-btn.is-done { border-color: var(--success); color: var(--success); }

/* ── Safety tips ──────────────────────────────────────── */

.safety-box {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid #ffe2b8;
  background: #fffcf5;
  border-radius: var(--radius);
}
.safety-box summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; list-style: none; color: #8a5a00; }
.safety-box summary::-webkit-details-marker { display: none; }
.safety-box ul { margin: 0.7rem 0 0.5rem; padding-left: 1.1rem; color: var(--text-soft); font-size: 0.85rem; display: grid; gap: 0.35rem; }

.seller-more {
  display: block;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Mobile action bar ────────────────────────────────── */

.mobile-action-bar { display: none; }

@media (max-width: 760px) {
  .mobile-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--mobile-tabs-offset, 0px);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.7rem max(1rem, env(safe-area-inset-right)) 0.7rem max(1rem, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(13, 38, 76, 0.08);
  }
  .mobile-price { font-size: 1.15rem; font-weight: 800; color: var(--brand-deep); white-space: nowrap; }
  .mobile-action-bar .btn { flex: 1; min-width: 0; max-width: 62%; overflow: hidden; }
  /* Leave room so the bar never covers the last section of the page. */
  .listing-detail ~ .detail-section:last-of-type, .report-link { padding-bottom: 4.5rem; }
}

@media (max-width: 960px) {
  .hero-search { display: none; }
}

/* ── 404 ──────────────────────────────────────────────── */

.error-code {
  font-size: clamp(3rem, 2rem + 6vw, 5rem);
  line-height: 1;
  margin-bottom: 0.4rem;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.notfound-search { margin: 1.6rem auto; }
.notfound-search input { border: 1.5px solid var(--border); background: var(--surface); }
.notfound-search .btn-primary { background: var(--grad-brand); }

/* ── Filter panel ─────────────────────────────────────── */

.filter-panel {
  scroll-margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
}
.filter-panel > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.filter-panel[open] > summary::after { content: "▴"; }
.filter-panel:not([open]) .filter-bar { display: none; }
.filter-panel .filter-bar { border: none; background: none; margin: 0; padding: 0 1rem 1rem; }
.filter-bar input:not([type="checkbox"]), .filter-bar select { min-height: 44px; font-size: 1rem; }
.filter-bar .filter-check { white-space: normal; }

.floating-filter {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: var(--shadow-lg);
  color: #fff;
  cursor: pointer;
}
.floating-filter[hidden] { display: none; }
.floating-filter:hover { box-shadow: var(--shadow); }
.floating-filter-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-deep);
  font-size: 0.7rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .category-carousel-controls { display: none; }
}
@media (max-width: 520px) {
  .filter-panel .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
}

/* ── Auth alternatives row ────────────────────────────── */


/* ── Search facets ────────────────────────────────────── */

.facet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: -0.4rem 0 1.2rem; }

/* ── Mobile app bottom sheet ─────────────────────────── */
.app-prompt-open { overflow: hidden; }
.app-prompt {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 480px);
  max-width: 100%;
  max-height: 85dvh;
  margin: auto auto 0;
  padding: 1.4rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -12px 48px #162b4826;
  text-align: center;
  overflow-y: auto;
}
.app-prompt::backdrop { background: #0c162650; }
.app-prompt-icon { width: 48px; height: 48px; margin: 0 auto 0.7rem; border-radius: 12px; }
.app-prompt h2 { margin: 0 1rem 0.5rem; font-size: 1.2rem; }
.app-prompt p { margin: 0 0 1rem; font-size: 0.86rem; line-height: 1.6; color: var(--text-soft); }
.app-prompt-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.app-prompt-close:hover { background: var(--brand-soft); }
.app-prompt-actions { display: grid; gap: 0.5rem; }
.app-prompt-actions .btn { min-height: 44px; width: 100%; }

/* ── Referral landing (/r/<code>) ──────────────────────────────────────────
   Seen only by someone without the app installed: anyone who has it is taken
   into the app by the universal link before this page renders. So the code
   itself is the page's whole job — it has to survive being read off a screen
   and typed into a phone. */
.referral-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 24px 0;
  padding: 20px;
  border: 1px dashed var(--brand);
  border-radius: 12px;
}
.referral-code__label {
  color: var(--muted);
  font-size: 13px;
}
.referral-code__value {
  /* Monospace and spaced out on purpose: this string gets copied by hand. */
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  letter-spacing: 4px;
  color: var(--text);
  word-break: break-all;
}
.referral-steps {
  margin: 0 0 24px;
  padding-inline-start: 20px;
  color: var(--text);
  line-height: 1.7;
}
.referral-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.referral-stores .btn { flex: 1 1 200px; text-align: center; }

/* ── Stores ───────────────────────────────────────────────────────────────
 *
 * A store is a business with a catalogue, so its card leads with the logo and
 * the name and keeps the rating where the eye already is. The directory reuses
 * the same card, which is why the grid rules live on the container rather than
 * on the card itself.
 */

.store-search { display: flex; gap: 0.6rem; margin: 1rem 0 1.5rem; }
.store-search input { flex: 1 1 auto; }

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

.store-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.store-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.store-card__logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.store-card__body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.store-card__body strong { display: flex; align-items: center; gap: 0.35rem; }
.store-card__body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-head {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.store-head__logo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.store-head__body { min-width: 0; }
.store-head__body h1 { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.3rem; }
.store-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0.5rem 0 0.9rem;
}

.store-rating { display: inline-flex; align-items: center; gap: 0.35rem; }
.store-rating strong { color: var(--brand-deep); }

/* The verification rosette (`IconVerified`). Brand blue, because verification
   is an assertion by tezsat about the seller — the same reason every platform
   that has one puts it in its own colour rather than a generic success green,
   which this was and which read as "task complete" next to a name. */
.verified-mark { color: var(--brand); flex: none; }

.review-list { list-style: none; display: grid; gap: 0.9rem; }
.review {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.review__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.review p { margin: 0; font-size: 0.93rem; line-height: 1.55; }

@media (max-width: 560px) {
  .store-head { flex-direction: column; align-items: center; text-align: center; }
  .store-head__meta { justify-content: center; }
}

/* ── Services ─────────────────────────────────────────────────────────────
 *
 * A service is a name, a sentence and a price, so the card is a row rather
 * than a tile — there is no image to build a tile around.
 */

.service-list { display: grid; gap: 0.7rem; margin-bottom: 1.5rem; }

.service-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.service-card__body { min-width: 0; }
.service-card__body h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.service-card__body p { margin: 0 0 0.35rem; font-size: 0.9rem; line-height: 1.5; }
.service-card__price { flex: 0 0 auto; text-align: right; }
.service-card__price strong { font-size: 1.1rem; color: var(--brand-deep); }

.request-list { list-style: none; display: grid; gap: 0.7rem; }
.request {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.request__head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.request p { margin: 0.3rem 0 0; }
.request code {
  padding: 0.1rem 0.4rem;
  background: var(--brand-soft);
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

@media (max-width: 520px) {
  .service-card { flex-direction: column; }
  .service-card__price { text-align: left; }
}

/* ── Coin packs ───────────────────────────────────────────────────────── */

.pack-list { list-style: none; display: grid; gap: 0.5rem; margin-bottom: 1.2rem; }
.pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pack__body { display: flex; flex-direction: column; }
.pack__price { font-weight: 700; color: var(--brand-deep); }

/* ── Invite code ──────────────────────────────────────────────────────── */

.invite-code {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.4rem;
}

/* ── Listing fee / quota note ─────────────────────────────────────────────
 *
 * Swapped in out of band when a category is chosen, and empty before that —
 * hence :empty, so the form has no stray gap while nothing is quoted.
 */

.listing-fee {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.85rem;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
}
.listing-fee:empty { display: none; }
.listing-fee strong { color: var(--brand-deep); }

/* Premium marker on a profile. Gold, and small: a status, not a headline. */
.badge-premium {
  margin-left: 0.5rem;
  vertical-align: middle;
  background: linear-gradient(135deg, #ffb020, #f5a524);
  color: #3a2500;
}

/* ── Full-size photo dialog ───────────────────────────────────────────────
 *
 * The inline `.gallery-main` stays cropped to 4:3 so a page of listings keeps
 * one rhythm; this is where the whole photo is shown instead. `contain` is the
 * entire point of the component — see the `object-fit` below.
 *
 * A <dialog> is `display: none` until opened, so the rules below only apply to
 * the open state; `::backdrop` is the browser's own layer behind it.
 */

.lightbox {
  /* Anchored here rather than inherited from the UA's `dialog:modal` rule.
     A dialog that is open but *not* modal keeps `position: absolute` with no
     offsets, which puts it at its static position — immediately after the
     gallery, a third of the way down the page — and takes the absolutely
     positioned close button and arrows with it. Every element is present and
     correctly styled in that state, so it reads as a layout bug rather than
     as a dialog that failed to go modal. Two declarations make it right
     either way. */
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  /* On the element, not only on ::backdrop, for the same reason: a non-modal
     dialog has no ::backdrop at all, so the page behind would stay bright. */
  background: rgba(8, 14, 24, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* The dialog itself is the click target for "close"; the children below sit
     above it and stop the click from reaching here. */
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Kept so the modal case dims from the very first frame, before the element
   itself paints. */
.lightbox::backdrop {
  background: rgba(8, 14, 24, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* `display: flex` above would otherwise show the dialog while it is closed. */
.lightbox:not([open]) { display: none; }

/* The whole image, never cropped — the reason this component exists. */
.lightbox__img {
  max-width: calc(100vw - 6rem);
  max-height: calc(100dvh - 6rem);
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(16, 24, 38, 0.7);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(16, 24, 38, 0.95);
  border-color: rgba(255, 255, 255, 0.5);
}
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: auto;
  height: 40px;
  padding: 0 1rem;
  border-radius: var(--pill);
  font-size: 0.85rem;
  font-weight: 600;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__nav[hidden] { display: none; }

.lightbox__counter {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* The inline photo is now a link; say so on hover without moving anything. */
.gallery-open { display: block; cursor: zoom-in; }
.gallery-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--radius-lg); }

/* Same 4:3 box as the photo it swaps with, so the page does not jump; a phone
   clip is usually portrait, so it is letterboxed rather than cropped. */
.gallery-video { display: block; object-fit: contain; background: #0b0f17; }
.gallery-open[hidden],
.gallery-video[hidden] { display: none; }

.gallery-thumb--video { position: relative; }
.gallery-thumb--video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  line-height: 28px;
  text-align: center;
  padding-left: 2px;
  pointer-events: none;
}
.gallery-thumb__blank { display: block; width: 84px; height: 64px; background: #0b0f17; }

@media (max-width: 560px) {
  .lightbox__img { max-width: 100vw; max-height: calc(100dvh - 5rem); border-radius: 0; }
  .lightbox__nav { width: 38px; height: 38px; }
  .lightbox__prev { left: 0.4rem; }
  .lightbox__next { right: 0.4rem; }
}

/* ── Sign-in tabs and phone field ─────────────────────────────────────────
 *
 * The tabs are radio inputs, switched by `:checked ~`. No JavaScript owns the
 * state, so the form works with scripting off and a failed submit cannot land
 * on a panel that has forgotten which tab it was.
 */

.auth-tab-input { position: absolute; opacity: 0; pointer-events: none; }

.auth-tab-row {
  display: flex;
  gap: 0.3rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
  background: #eef1f6;
  border-radius: var(--pill);
}
.auth-tab {
  flex: 1 1 0;
  padding: 0.5rem 0.9rem;
  border-radius: var(--pill);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.auth-tab:hover { color: var(--brand-deep); }

/* Panels are hidden by default and revealed by the matching radio. */
.auth-panel { display: none; }
#tab-phone:checked ~ .auth-tab-row .auth-tab[for="tab-phone"],
#tab-email:checked ~ .auth-tab-row .auth-tab[for="tab-email"] {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 1px 3px rgba(12, 22, 38, 0.12);
}
#tab-phone:checked ~ .auth-panel-phone,
#tab-email:checked ~ .auth-panel-email { display: block; }

/* Keyboard focus lands on the radio, which is invisible — so show it on the
   label the radio belongs to, or a keyboard user cannot see where they are. */
.auth-tab-input:focus-visible ~ .auth-tab-row .auth-tab[for="tab-phone"],
.auth-tab-input:focus-visible ~ .auth-tab-row .auth-tab[for="tab-email"] {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Country picker beside the number. The select sizes to its content so the
   long country names do not stretch the field; the number takes the rest. */
.phone-field { display: flex; gap: 0.5rem; }
.phone-field select { flex: 0 0 auto; max-width: 42%; }
.phone-field input { flex: 1 1 auto; min-width: 0; }

@media (max-width: 420px) {
  .phone-field { flex-direction: column; }
  .phone-field select { max-width: none; }
}

/* ── Warehouse ─────────────────────────────────────────────────────── */
.card-body .badge-warehouse { margin-top: 0.3rem; align-self: flex-start; }
.detail-warehouse { margin: -0.4rem 0 0.8rem; }
.warehouse-card, .warehouse-status {
  display: grid;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem;
  margin: 1.2rem 0;
  background: var(--brand-soft);
  border-radius: var(--radius);
}
.warehouse-card h2, .warehouse-status h2 { font-size: 1.1rem; margin: 0; }
.warehouse-card .badge-warehouse { justify-self: start; background: var(--surface); }
.warehouse-info { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.warehouse-info li { display: flex; align-items: center; gap: 0.45rem; }
.choice-group { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.choice-group legend { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.4rem; }
.stack-form .choice { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; padding: 0.7rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.stack-form .choice span { display: grid; gap: 0.15rem; color: var(--text); }

/* Marketplace refresh: keep search, browsing and selling visible at every size. */
:root { --text: #17243b; --text-soft: #4b5b73; --bg: #f7f9fc; }
.site-header { background: #fff; }
.nav-wrap { height: 72px; gap: 1.5rem; }
.nav-search { max-width: 520px; min-height: 44px; border-radius: 12px; }
.nav-guest-post { gap: 0.45rem; }
.hero-search { background: #fff; padding: 0.35rem; border: 1px solid #d4e1f2; border-radius: 14px; margin: 1.2rem 0 0.9rem; box-shadow: var(--shadow-sm); }
.hero-search input { border-radius: 10px; }
.hero-search .btn { border-radius: 10px; min-height: 44px; }
.hero-search .btn-primary { background: var(--brand-deep); }
.hero-search .btn-primary:hover { background: var(--brand-dark); }
.section-head { align-items: center; }
.section-link { flex: none; min-height: 44px; font-size: 0.8rem; }
.listing-card { box-shadow: 0 2px 6px #162b4810; border-radius: 12px; }
.card-price { color: var(--text); font-size: 1.1rem; }
.listing-card.is-boosted { border-color: var(--border); }
.card-media .badge-boost { display: grid; place-items: center; padding: 0; width: 28px; height: 28px; color: var(--brand); background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); }
.stack-form input:disabled, .stack-form select:disabled, .stack-form fieldset:disabled { opacity: 0.7; cursor: not-allowed; }
.stack-form input[type="file"] { padding: 1rem; background: var(--brand-soft); border: 1px dashed #a7bdda; border-radius: 12px; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.photo-preview:empty { display: none; }
.photo-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.photo-preview-count { flex-basis: 100%; font-size: 0.82rem; color: var(--text-soft); }
.home-promotions { margin-top: 1.6rem; }
.promotion-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.65rem; }
.promotion-toolbar h2 { font-size: 1rem; margin: 0; }
.home-banner-rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 1rem) / 2); gap: 1rem; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; padding: 3px 0 0.5rem; }
.home-banner-rail:has(> :only-child) { grid-auto-columns: 100%; }
.home-banner { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 200px; overflow: hidden; border-radius: 16px; color: #fff; background: var(--brand); scroll-snap-align: start; }
.home-banner:hover { color: #fff; }
.home-banner-background, .home-banner-image, .home-banner-scrim { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.home-banner-image { object-fit: cover; }
.home-banner-scrim { background: linear-gradient(90deg, #07172ae6, #07172a50); }
.home-banner-copy { padding: 1.5rem; max-width: 90%; }
.home-banner-copy h3 { font-size: 1.3rem; overflow-wrap: anywhere; }
.home-banner-copy p { font-size: 0.85rem; margin: 0.6rem 0; overflow-wrap: anywhere; }
.home-banner-cta { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem; margin-top: 0.5rem; background: #fff; border-radius: 8px; color: #17243b; font-size: 0.8rem; font-weight: 600; }
.back-to-top { position: fixed; bottom: max(1rem, env(safe-area-inset-bottom)); left: max(1rem, env(safe-area-inset-left)); z-index: 45; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--brand-deep); box-shadow: var(--shadow); }
.back-to-top[hidden] { display: none; }
.back-to-top .icon { transform: rotate(-90deg); }
@media (max-width: 960px) {
  .nav-wrap { gap: 0.8rem; }
  .nav-search { max-width: none; }
}
@media (max-width: 760px) {
  .nav-wrap { height: auto; gap: 0.5rem; padding-block: 0.55rem; grid-template-columns: 44px minmax(0, 1fr) auto auto auto; }
  .nav-wrap > .market-menu { grid-area: 1 / 1; }
  .nav-wrap > .brand { grid-area: 1 / 2; }
  .nav-actions .nav-app { grid-area: 1 / 3; }
  .nav-actions .lang-menu { grid-area: 1 / 4; }
  .nav-sign-in { grid-area: 1 / 5; }
  .nav-actions .nav-post, .nav-actions .nav-guest-post { display: none; }
  .nav-actions .user-menu { grid-area: 1 / 5; }
  .nav-wrap .nav-icons { display: none; }
  .section-head { flex-wrap: wrap; gap: 0.25rem 0.8rem; }
  .section-link { min-height: 32px; }
  .home-banner-rail { grid-auto-columns: 90%; gap: 0.75rem; }
  .home-banner { min-height: 100px; }
  .home-banner-copy { padding: 0.75rem 1rem; max-width: 100%; }
  .home-banner-copy h3 { font-size: 0.95rem; margin: 0; }
  .home-banner-copy p { display: none; }
  .home-banner-cta { padding: 0; background: none; color: #fff; margin-top: 0.35rem; min-height: 24px; }
  .home-promotions { margin-top: 0.85rem; }
}
@media (max-width: 520px) {
  .nav-guest-post span { display: none; }
  .nav-sign-in { grid-column: 5; }
  .card-price { font-size: 1rem; }
  .section-head h2 { font-size: 1.15rem; }
}
.store-search input { min-width: 0; min-height: 44px; padding: 0.65rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 1rem; }
.home-banner-scrim { background: linear-gradient(90deg, #07172ac9, #07172a45); }

/* ==========================================================================
   App-style screens — signing in and posting a listing.

   The app's v1.1 auth and create-listing screens, carried over: raised white
   cards with a hairline edge, inputs in a sunken fill that light up with a
   ring on focus, a solid full-width call to action, and every listing field in
   a card of its own behind an icon well.

   Colours are the app's own where they differ from the site's: a filled
   button sits on `--app-strong`, because white on the brand blue is 3.96:1
   and fails for a 15px label; brand-coloured text uses `--app-text`.
   ========================================================================== */

:root {
  --app-chip: #eef1f6;
  --app-line: #e6eaf1;
  --app-strong: #0b6fd6;
  --app-strong-hover: #0a5aaf;
  --app-text: #0a66c2;
  --app-soft: #e7f2fe;
  --app-soft-hover: #d9eafd;
  --app-success: #0e8659;
  --app-success-soft: #e3f4ec;
  --app-hover-line: #cfdcec;
  --app-card-radius: 22px;
  --app-input-radius: 15px;
}

/* ── Focused chrome: the app's auth top bar in place of the marketplace header ── */

.focus-bar__inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(520px, 100% - 2.25rem);
  min-height: 64px;
  margin-inline: auto;
  padding-top: 0.4rem;
}
.focus-bar__spacer { flex: 1; }
.is-focus .flash-wrap { width: min(520px, 100% - 2.25rem); }

.app-brand { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--brand); }
.app-brand:hover { color: var(--brand); }
.app-brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand);
}
.app-brand__mark img { width: 17px; height: 21px; }
.app-brand__name { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }

.pill-action {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: var(--pill);
  background: var(--app-soft);
  color: var(--app-text);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-action:hover { background: var(--app-soft-hover); color: var(--app-text); }

/* Bare, like the app's: the chevron is the affordance, the 40px circle the target. */
.screen-back {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: -0.6rem;
  border-radius: 50%;
  color: var(--text);
}
.screen-back:hover { background: var(--app-chip); color: var(--text); }
.screen-back .icon { transform: rotate(180deg); }

/* ── Shared controls ── */

.auth-form :is(input[type="text"], input[type="email"], input[type="tel"]),
.auth-form select,
.screen-form :is(input[type="text"], input[type="number"], input[type="email"], input[type="tel"]),
.screen-form select,
.screen-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.9rem;
  border: 2px solid transparent;
  border-radius: var(--app-input-radius);
  background-color: var(--app-chip);
  color: var(--text);
  /* 16px, so iOS does not zoom the page when a field takes focus. */
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.auth-form select,
.screen-form select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  text-overflow: ellipsis;
}
.screen-form textarea { min-height: 140px; line-height: 1.5; resize: vertical; }
/* No spin buttons, as in the app; the arrow keys still step the value. */
.screen-form input[type="number"] { appearance: textfield; }
.screen-form input[type="number"]::-webkit-inner-spin-button,
.screen-form input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.auth-form :is(input, select):focus,
.screen-form :is(input, select, textarea):focus {
  border-color: var(--brand);
  background-color: var(--surface);
}
.auth-form ::placeholder,
.screen-form ::placeholder { color: var(--muted); opacity: 1; }
/* Only once the visitor has touched the field, so an empty form is not all red. */
.auth-form :is(input, select):user-invalid,
.screen-form :is(input, select, textarea):user-invalid { border-color: var(--danger); }
.screen-form :disabled { opacity: 0.6; cursor: not-allowed; }

.btn.screen-submit {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  background: var(--app-strong);
  box-shadow: none;
  font-size: 1rem;
  font-weight: 700;
}
.btn.screen-submit:hover { background: var(--app-strong-hover); box-shadow: none; transform: none; }

.optional-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  background: var(--app-chip);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: 0.1em;
}

/* ── Sign-in screens ── */

.auth-screen { width: min(520px, 100% - 2.25rem); margin: 0.5rem auto 3rem; }
.auth-copy { margin: 1.1rem 0 1.4rem; }
.auth-copy h1 { margin: 0 0 0.4rem; font-size: clamp(1.7rem, 1.45rem + 1vw, 1.9rem); letter-spacing: -0.03em; line-height: 1.2; }
.auth-copy p { max-width: 36ch; margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }

.auth-card {
  position: relative;
  padding: 1.125rem;
  border: 1px solid var(--app-line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.auth-form { display: grid; gap: 1rem; }
.auth-field { display: grid; gap: 0.5rem; }
.auth-field__title { color: var(--text); font-size: 1.06rem; font-weight: 600; }
.auth-field__hint { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.auth-legal { margin: 1rem 0.5rem 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; text-align: center; }

/* The card is phone-width at every size, so the country always gets a row of
   its own: beside the number it was cut to "Azərbaycan +9", losing the code. */
.auth-form .phone-field { flex-direction: column; }
.auth-form .phone-field select { max-width: none; }

/* The phone/email switch, as the app's segmented control. */
.auth-tabs .auth-tab-row { gap: 0; margin: 0 0 0.25rem; padding: 4px; border-radius: var(--app-input-radius); background: var(--app-chip); }
.auth-tabs .auth-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.6rem;
  border-radius: 11px;
  font-size: 0.875rem;
}
#tab-phone:checked ~ .auth-tab-row .auth-tab[for="tab-phone"],
#tab-email:checked ~ .auth-tab-row .auth-tab[for="tab-email"] {
  color: var(--app-text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(13, 38, 76, 0.08), 0 1px 6px rgba(13, 38, 76, 0.06);
}

/* Six cells over the real input — see `app.js`. Without the script the input
   shows as it is: one wide, spaced-out code field. */
.otp-field { position: relative; }
.auth-form .otp-input { min-height: 56px; text-align: center; letter-spacing: 0.5em; font-size: 1.3rem; font-weight: 700; }
.otp-cells { display: none; }
.otp-field.is-enhanced .otp-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; }
.otp-cells span {
  display: grid;
  place-items: center;
  height: 58px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--app-chip);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.otp-cells span.is-filled { border-color: var(--app-line); background: var(--surface); }
.otp-cells span.is-active { border-color: var(--brand); background: var(--surface); }
.auth-form .otp-field.is-enhanced .otp-input,
.auth-form .otp-field.is-enhanced .otp-input:focus {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  letter-spacing: 0;
  font-size: 16px;
  outline: none;
  cursor: text;
}
.otp-field.is-enhanced .otp-input::selection { background: transparent; }
/* The active cell is the focus indicator, so keyboard focus still shows. */
.otp-field.is-enhanced:focus-within .otp-cells span.is-active { box-shadow: 0 0 0 3px rgba(13, 127, 242, 0.15); }

.auth-resend { display: flex; justify-content: center; margin-top: 0.75rem; }
.auth-resend .link-button { min-height: 44px; padding: 0 0.75rem; color: var(--app-text); font-size: 0.9rem; font-weight: 700; }
.auth-resend .link-button:disabled { color: var(--muted); font-weight: 500; text-decoration: none; cursor: default; }

/* ── Listing screens ── */

.page.screen { max-width: 680px; padding-top: 1.25rem; }

.screen-head { display: flex; align-items: center; gap: 0.25rem; margin-bottom: 0.9rem; }
.screen-head h1 { margin: 0; font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.6rem); letter-spacing: -0.02em; }

.step-header {
  margin-bottom: 0.875rem;
  padding: 1rem;
  border: 1px solid var(--app-line);
  border-radius: var(--app-card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.step-header__row { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 0.875rem; }
.step-header__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--app-strong);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.step-header__text { display: grid; gap: 0.1rem; min-width: 0; }
.step-header__text strong { font-size: 0.95rem; line-height: 1.3; }
.step-header__text small { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.step-header__bar { display: flex; gap: 6px; }
.step-header__bar span { flex: 1; height: 5px; border-radius: 3px; background: var(--app-chip); }
.step-header__bar span.is-done { background: var(--app-strong); }

.cat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--app-soft);
  color: var(--brand);
}
.cat-icon.lg { width: 52px; height: 52px; }

.picker-heading { display: flex; align-items: center; gap: 0.6rem; margin: 1.25rem 0 0.8rem; font-size: 1.25rem; letter-spacing: -0.02em; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.picker-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  height: 100%;
  min-height: 112px;
  padding: 0.875rem 0.4rem;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.picker-tile:hover { border-color: var(--app-hover-line); box-shadow: var(--shadow-sm); color: var(--text); }
.picker-tile__label { font-size: 0.8rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.picker-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.picker-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--app-line);
  border-radius: var(--app-input-radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}
.picker-row > span { flex: 1; min-width: 0; }
.picker-row .icon { color: var(--muted); }
.picker-row:hover { border-color: var(--app-hover-line); color: var(--text); }

.chosen-category {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--app-line);
  border-radius: var(--app-input-radius);
  background: var(--surface);
  color: var(--text);
}
a.chosen-category:hover { border-color: var(--app-hover-line); color: var(--text); }
.chosen-category.is-locked { margin-bottom: 0.4rem; }
.chosen-category__text { display: grid; flex: 1; min-width: 0; }
.chosen-category__text small { color: var(--text-soft); font-size: 0.75rem; }
.chosen-category__text strong { overflow: hidden; font-size: 0.95rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chosen-category__change { color: var(--app-text); font-size: 0.8rem; font-weight: 700; }
.screen-note { margin: 0 0 0.875rem; color: var(--muted); font-size: 0.8rem; }

.screen .listing-fee { margin-bottom: 0.875rem; padding: 0.75rem 1rem; border-radius: var(--app-input-radius); background: var(--app-soft); }
.screen .listing-fee strong { color: var(--app-text); }
.screen .listing-fee.is-free { background: var(--app-success-soft); }
.screen .listing-fee.is-free strong { color: var(--app-success); }

.screen-form { display: grid; gap: 0.875rem; }
.screen-form > .hint { margin: 0; }

.field-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--app-line);
  border-radius: var(--app-card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.field-card__head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.875rem; }
.field-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--app-soft);
  color: var(--brand);
}
.field-card__titles { display: grid; align-content: center; gap: 0.1rem; min-width: 0; min-height: 50px; }
.field-card__label { color: var(--text); font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.field-card__label label { cursor: pointer; }
.field-card__req { margin-left: 0.2rem; color: var(--danger); }
.field-card__hint { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.field-card__note { display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.78rem; }

.attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.attr-field { display: grid; gap: 0.35rem; min-width: 0; color: var(--text-soft); font-size: 0.82rem; font-weight: 600; }
.check-rows { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 0.5rem; }
.check-row { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; color: var(--text); font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.check-row input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--app-strong); }

/* A multi-select attribute: one tickable tile per option. */
.attr-field--multi { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.attr-field--multi legend { padding: 0; margin-bottom: 0.35rem; }
.multi-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 0.5rem; }
.multi-check { display: flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0.4rem 0.75rem; border: 1px solid var(--app-line); border-radius: var(--radius-sm); color: var(--text); font-size: 0.88rem; font-weight: 500; cursor: pointer; }
.multi-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.multi-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--app-strong); }
.multi-check .icon { flex: none; color: var(--brand); }
/* One long word ("Электростеклоподъёмники") must break inside its tile, not spill out. */
.multi-check span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

.price-field { display: flex; gap: 0.5rem; }
.screen-form .price-field input { flex: 1 1 auto; min-width: 0; }
.screen-form .price-field select { flex: 0 0 auto; width: auto; min-width: 7.5rem; }
.price-field__unit { display: grid; place-items: center; flex: none; min-width: 7.5rem; padding: 0 0.75rem; border: 1px solid var(--app-line); border-radius: var(--app-input-radius); background: var(--app-chip); color: var(--text-soft); font-size: 0.9rem; font-weight: 600; }
.field-card__note--tip { padding: 0.45rem 0.65rem; border-radius: 12px; background: var(--app-success-soft); color: var(--app-success); }

/* ── New listing: one form in steps ──
   Which branch shows follows the type radio, in CSS alone so it holds without
   the page script. With the script (`is-stepped`), one step shows at a time. */
.new-listing:has(input[name="type"][value="AUCTION"]:checked) [data-for="SELL"],
.new-listing:has(input[name="type"][value="SELL"]:checked) [data-for="AUCTION"] { display: none; }
.wizard-step { display: grid; gap: 0.875rem; min-width: 0; }
.wizard-step .step-header { margin-bottom: 0; }
.wizard-step .step-header:focus { outline: none; }
.wizard-step .chosen-category, .wizard-step .listing-fee { margin-bottom: 0; }
.new-listing.is-stepped .wizard-step:not(.is-current) { display: none; }
.wizard-nav { display: flex; gap: 0.625rem; }
.wizard-nav .btn.screen-submit { flex: 1; width: auto; }
.wizard-nav__back { flex: none; min-height: 56px; border-radius: 18px; }
/* Moving between steps is the script's; without it, only the submit shows. */
.new-listing:not(.is-stepped) :is([data-step-next], [data-step-back]) { display: none; }

.type-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
.type-choice__option { position: relative; display: block; cursor: pointer; }
.type-choice__option input { position: absolute; opacity: 0; pointer-events: none; }
.type-choice__body {
  display: grid;
  gap: 0.2rem;
  height: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--app-line);
  border-radius: var(--app-input-radius);
  background: var(--app-chip);
}
.type-choice__body strong { color: var(--text); font-size: 0.95rem; }
.type-choice__body small { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.type-choice__option input:checked + .type-choice__body { border-color: var(--brand); background: var(--app-soft); }
.type-choice__option input:focus-visible + .type-choice__body { outline: 2.5px solid var(--brand); outline-offset: 2px; }

.auction-tip { padding: 0.875rem 1rem; border: 1px solid var(--app-line); border-radius: var(--app-card-radius); background: var(--app-soft); color: var(--app-text); font-size: 0.88rem; line-height: 1.5; }
.auction-tip p { margin: 0; }
.auction-tip p + p { margin-top: 0.5rem; }
.auction-tip strong { font-weight: 700; }

.photo-picker { display: grid; gap: 0.75rem; }
.photo-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1.5px dashed #a7bdda;
  border-radius: 18px;
  background: var(--app-soft);
  color: var(--app-text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.photo-drop:hover { border-color: var(--brand); background: var(--app-soft-hover); }
.photo-drop:has(.photo-drop__input:focus-visible) { border-color: var(--brand); outline: 2.5px solid var(--brand); outline-offset: 2px; }
.photo-drop__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-drop__cta { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 0.92rem; font-weight: 700; pointer-events: none; }

@media (max-width: 560px) {
  /* Three across on a phone, as the app lays its category grid. */
  .picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .picker-tile { min-height: 104px; padding-inline: 0.25rem; }
  .field-card, .step-header { padding: 0.875rem; }
  .auth-card { padding: 1rem; }
}
@media (max-width: 380px) {
  .pill-action { padding: 0 0.75rem; }
  .app-brand__name { font-size: 1.25rem; }
  .otp-field.is-enhanced .otp-cells { gap: 0.35rem; }
}

/* App-style navigation stays within thumb reach on mobile. The shared offset
   also keeps listing actions, chat composers and floating controls above it. */
@media (max-width: 760px) {
  .has-mobile-tabs {
    --mobile-tabs-offset: calc(72px + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--mobile-tabs-offset);
  }
  .has-mobile-tabs:has(.mobile-action-bar) { --mobile-action-offset: 4.5rem; }
  .has-mobile-tabs .user-menu-panel, .has-mobile-tabs .lang-panel {
    max-height: calc(100dvh - var(--mobile-tabs-offset) - 4.5rem);
  }
  html:has(.has-mobile-tabs) {
    scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  html:has(.has-mobile-tabs .mobile-action-bar) {
    scroll-padding-bottom: calc(88px + 4.5rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-tabs {
    position: fixed;
    inset: auto 0 0;
    z-index: 85;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    height: var(--mobile-tabs-offset);
    padding: 6px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -4px 24px rgba(13, 38, 76, 0.06);
  }
  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 60px;
    padding: 4px 2px;
    border-radius: 12px;
    color: var(--text-soft);
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.25;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tab__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 32px;
    border-radius: 12px;
  }
  .mobile-tab__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-tab:hover, .mobile-tab.is-active { color: var(--brand-deep); }
  .mobile-tab.is-active { font-weight: 700; }
  .mobile-tab.is-active .mobile-tab__icon { background: var(--brand-soft); }
  .mobile-tab--post .mobile-tab__icon {
    height: 44px;
    margin-top: -12px;
    border-radius: 15px;
    background: var(--grad-brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 127, 242, 0.24);
  }
  .mobile-tab--post.is-active .mobile-tab__icon { background: var(--grad-brand); outline: 2px solid var(--brand-deep); outline-offset: 3px; }
  .mobile-tab:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: -2px; }
  .has-mobile-tabs .chat-compose { bottom: var(--mobile-tabs-offset); }
  .has-mobile-tabs .floating-filter, .has-mobile-tabs .back-to-top {
    bottom: calc(var(--mobile-tabs-offset) + var(--mobile-action-offset, 0px) + 1rem);
  }
}

/* Real-estate address and optional map pin. */
.attr-field--map { grid-column: 1 / -1; }
.location-picker { display: grid; gap: .75rem; }
.location-picker label { display: grid; gap: .35rem; }
.location-map { height: 280px; width: 100%; border-radius: 12px; z-index: 0; }
.location-coordinates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.detail-location { margin: 1.5rem 0; }
.detail-location a { display: inline-block; margin-top: .5rem; }

/* ── Fast Sell ─────────────────────────────────────────────────────── */
.badge-fast-sell { background: rgba(245, 165, 36, 0.16); color: #8a5a00; }
.badge-fast-buyer { background: rgba(111, 82, 234, 0.12); color: var(--accent); }
.badge-fast-buyer a { color: inherit; text-decoration: underline; }
.card-body .badge-fast-sell { margin-top: 0.3rem; align-self: flex-start; }
.store-head__meta .badge-fast-buyer { align-self: center; }
.fast-sell {
  display: grid;
  gap: 0.6rem;
  padding: 1.1rem 1.2rem;
  margin: 1.2rem 0;
  background: var(--brand-soft);
  border-radius: var(--radius);
}
.fast-sell__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; }
.fast-sell__head h2 { font-size: 1.1rem; margin: 0; }
.fast-sell__window { font-size: 0.85rem; font-weight: 600; color: #8a5a00; }
.fast-sell__window.is-closed { color: var(--muted); }
.fast-sell .offer-form { margin-top: 0.4rem; }
.offer-form .price-field input { flex: 1 1 auto; min-width: 0; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.offer-row { display: grid; gap: 0.35rem; padding: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.offer-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.offer-row__title { font-weight: 600; color: var(--text); }
.offer-row__amount { font-size: 1.1rem; font-weight: 700; }
.offer-row__note { margin: 0; color: var(--text-soft); overflow-wrap: anywhere; }
.offer-row__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.offer-row__actions form { margin: 0; }
.feed-row { grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 0.8rem; }
.feed-row__body { display: grid; gap: 0.3rem; min-width: 0; }
.feed-row__body p { margin: 0; }
.feed-row__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.fast-buyer-store__categories { margin: 0; padding-left: 1.2rem; }
.fast-buyer-categories details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.8rem; background: var(--surface); }
.fast-buyer-categories summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.fast-buyer-categories .multi-checks { margin-top: 0.5rem; }
.feed-row__thumb.is-empty { display: block; background: var(--bg); }
.detail-fast-sell { margin: -0.4rem 0 0.8rem; }

/* ── Top bar: app download ────────────────────────────── */

.nav-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.5rem;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-app:hover { background: var(--brand-soft); color: var(--brand-deep); }
/* The search box needs the room first; the icon alone still says it. */
@media (max-width: 1160px) {
  .nav-app span { display: none; }
  .nav-app { padding: 0; }
}

/* ── Home: category shortcuts ─────────────────────────── */

.home-categories { position: relative; margin-top: 1.25rem; }
.category-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.category-shortcut {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 100%;
  min-height: 64px;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  transition: box-shadow 0.16s ease, border-color 0.16s;
}
.category-shortcut:hover { box-shadow: var(--shadow); border-color: #d7e0ec; color: var(--brand-deep); }
.category-shortcut__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.category-shortcut__label { min-width: 0; overflow-wrap: anywhere; }

/* "Show more" grows the grid in place: the extra tiles continue the rows above
   and the toggle drops below them, where it reads "Show less". Browsers that
   cannot lay out `details` as flex keep the toggle on top, still working. */
.category-more { display: flex; flex-direction: column; margin-top: 0.75rem; }
.category-more > summary {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: fit-content;
  min-height: 44px;
  margin-inline: auto;
  padding: 0 0.9rem;
  border-radius: 10px;
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.category-more > summary::-webkit-details-marker { display: none; }
.category-more > summary:hover { background: var(--brand-soft); }
.category-more > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.category-more > summary .icon { transform: rotate(90deg); transition: transform 0.16s ease; }
.category-more[open] > summary .icon { transform: rotate(-90deg); }
.category-more__hide,
.category-more[open] .category-more__show { display: none; }
.category-more[open] .category-more__hide { display: inline; }
.category-more__all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 44px;
  margin-top: 0.5rem;
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 600;
}

/* On a phone the tile stacks, so four still fit across and all eight stay in
   two rows; a long label is clipped at two lines rather than growing the row. */
@media (max-width: 760px) {
  .home-categories { margin-top: 0.85rem; }
  .category-shortcuts { gap: 0.4rem; }
  .category-shortcut {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.35rem;
    padding: 0.55rem 0.1rem;
    font-size: 0.69rem;
    text-align: center;
  }
  .category-shortcut__label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .category-more { margin-top: 0.4rem; }
}
