/* BritListings */

:root {
  --ink: #111318;
  --ink-2: #4A505E;
  --muted: #5B6170;
  --line: #E4E6EB;
  --chip-line: #DDE0E6;
  --soft: #F1F2F5;
  --soft-2: #F4F5F8;
  --bg: #FFFFFF;
  --acc: #2B44FF;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

a { color: var(--ink); }
a:hover { color: var(--acc); }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--acc);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { color: #FFFFFF; filter: brightness(1.1); }
.btn-lg { min-height: 56px; padding: 0 32px; font-size: 18px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.logo { flex: 0 0 auto; font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo b { font-weight: 800; }

/* Header + category row, sticky together */

.top { position: sticky; top: 0; z-index: 10; background: var(--bg); }

.hd { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 16px 24px; }

.search {
  flex: 999 1 420px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 2px solid var(--ink);
  border-radius: 18px;
}
.search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 18px;
  padding: 10px 12px;
  color: var(--ink);
}
.search input::placeholder { color: #6B7180; }
.search button {
  flex: 0 0 auto;
  width: 48px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  background: var(--acc);
  color: #FFFFFF;
  cursor: pointer;
}
.search button svg { width: 20px; height: 20px; stroke-width: 2.2; }

.hd-nav { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.hd-nav > a:not(.btn) { padding: 10px 14px; font-size: 17px; font-weight: 500; text-decoration: none; }

.rail { display: flex; gap: 8px; padding: 8px 24px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }

.rail-item {
  flex: 0 0 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: #3A3F4B;
}
.rail-item svg {
  width: 24px;
  height: 24px;
  padding: 16px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--soft);
  transition: border-radius .15s, background .15s, padding .15s;
}
.rail-item:hover { color: var(--ink); }
.rail-item:hover svg { border-radius: 16px; background: #E6E8EE; }
.rail-item.on { color: var(--ink); font-weight: 600; }
.rail-item.on svg { border-radius: 16px; background: var(--acc); color: #FFFFFF; }

.top.compact .rail { padding: 6px 24px; }
.top.compact .rail-item span { display: none; }
.top.compact .rail-item svg { padding: 10px; }

/* Feed */

.feed { padding-top: 32px; padding-bottom: 56px; }
.strap { margin: 0; color: var(--ink-2); }
.h1 { margin: 12px 0 0; font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
.h2 { margin: 0; font-family: var(--display); font-size: clamp(36px, 4vw, 52px); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }

.chips { margin-top: 20px; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.empty { margin-top: 28px; padding: 56px 24px; border: 1px dashed var(--chip-line); border-radius: 24px; text-align: center; }
.empty p { margin: 0 0 20px; font-size: 20px; color: var(--ink-2); }

/* Post promo */

.promo { padding: 56px; border-radius: 32px; background: var(--soft-2); }
.promo-txt { max-width: 560px; }
.promo-txt > p { margin: 18px 0 0; font-size: 20px; color: var(--ink-2); }
.steps { margin: 32px 0 36px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; align-items: center; gap: 16px; font-size: 19px; }
.steps span { flex: 0 0 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ink); color: #FFFFFF; font-weight: 600; }

/* Trust */

.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 72px; }
.trust svg { width: 32px; height: 32px; stroke-width: 1.8; }
.trust h3 { margin: 10px 0 0; font-family: var(--display); font-size: 24px; font-weight: 700; }
.trust p { margin: 6px 0 0; color: var(--ink-2); }

/* Footer */

.ft { border-top: 1px solid var(--line); }
.ft-in { max-width: 1240px; margin: 0 auto; padding: 40px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.ft .logo { font-size: 22px; }
.ft-nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 16px; }

@media (max-width: 860px) {
  .hd { justify-content: space-between; }
  .search { order: 3; flex-basis: 100%; }
}

@media (max-width: 600px) {
  .hd { padding: 12px 16px; }
  .rail { padding: 8px 16px 10px; }
  .top.compact .rail { padding: 6px 16px; }
  .rail-item { flex-basis: 76px; }
  .wrap { padding: 0 16px; }
  .h1 { font-size: 32px; }
  .promo { padding: 32px 24px; }
}

/* Messages */

.flash { margin: 16px 0 0; padding: 14px 18px; border-radius: 14px; background: var(--soft-2); }

/* Ad cards */

.grid { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.card:hover { color: var(--ink); }
.card:hover .card-title { color: var(--acc); }
.card img, .card .ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 10px; border-radius: 18px; background: #ECEEF2; }
.card-price { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.card-title { font-size: 19px; font-weight: 500; line-height: 1.35; }
.card-meta { font-size: 16px; color: var(--muted); }

/* Post form */

.narrow { max-width: 760px; padding-top: 32px; padding-bottom: 72px; }
.form { margin-top: 28px; display: flex; flex-direction: column; gap: 24px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 600; }
.field input:not([type=file]), .field select, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid #C9CDD6;
  border-radius: 14px;
  background: var(--bg);
  font: inherit;
  color: var(--ink);
}
.field textarea { min-height: 180px; resize: vertical; }
.field input[type=file] { padding: 18px; border: 1.5px dashed #C9CDD6; border-radius: 14px; font: inherit; }
.field :is(input, select, textarea):focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: var(--acc); }
.field.bad :is(input, select, textarea) { border-color: #B42318; }
.money { position: relative; }
.money span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field .money input { padding-left: 34px; }
.hint { margin: 0; font-size: 16px; color: var(--muted); }
.err { margin: 0; font-size: 16px; font-weight: 500; color: #B42318; }

/* Ad page */

.ad { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; align-items: start; padding-top: 32px; padding-bottom: 72px; }
.ad-media { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 24px; }
.ad-media img, .ad-media .ph { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; border-radius: 24px; background: #ECEEF2; }
.ad-media .ph { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.note { margin: 12px 0 0; font-size: 16px; color: var(--muted); }
.ad-price { margin: 0; font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.ad-title { margin: 4px 0 0; font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.15; }
.ad-meta { margin: 10px 0 0; color: var(--muted); }
.ad-desc { margin-top: 24px; }
.ad-seller { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); }

@media (max-width: 860px) {
  .ad { grid-template-columns: 1fr; gap: 24px; }
}

/* Auth and info pages */

.alt { margin: 28px 0 0; color: var(--ink-2); }
.page { max-width: 760px; margin: 0 auto; padding: 32px 24px 72px; }
.page h1 { margin: 0 0 16px; font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -0.025em; }

/* Messages */

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--acc); color: #FFFFFF; font-size: 13px; font-weight: 600; line-height: 1; }

.ask { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.ask label { font-weight: 600; }
.ask textarea, .chat-send textarea { width: 100%; padding: 12px 16px; border: 1.5px solid #C9CDD6; border-radius: 14px; font: inherit; color: var(--ink); resize: vertical; }
.ask textarea:focus, .chat-send textarea:focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: var(--acc); }
.ask .btn { align-self: flex-start; }

.convs { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.conv { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.conv:hover { color: var(--ink); }
.conv img, .conv .ph { flex: 0 0 72px; width: 72px; height: 72px; object-fit: cover; border-radius: 14px; background: #ECEEF2; }
.conv-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.conv-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv:hover .conv-title { color: var(--acc); }
.conv-meta { font-size: 15px; color: var(--muted); }
.conv-last { font-size: 16px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.new .conv-last { color: var(--ink); font-weight: 500; }

.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.back svg { width: 20px; height: 20px; }
.chat-head { margin-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.chat-title { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.2; }
.chat-title a { text-decoration: none; }
.chat-meta { margin: 6px 0 0; color: var(--muted); }

.msgs { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.msg { align-self: flex-start; max-width: 80%; padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: var(--soft); }
.msg.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--acc); color: #FFFFFF; }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg time { display: block; margin-top: 4px; font-size: 13px; opacity: .75; }

.chat-send { position: sticky; bottom: 0; margin-top: 20px; padding: 12px 0 16px; display: flex; gap: 10px; align-items: flex-end; background: var(--bg); }
.chat-send textarea { flex: 1 1 auto; min-height: 52px; }
.chat-send .btn { flex: 0 0 auto; min-height: 52px; }

/* Account */

.h3 { margin: 40px 0 0; font-family: var(--display); font-size: 26px; font-weight: 700; }
button.chip { background: var(--bg); font-family: inherit; cursor: pointer; color: var(--ink); }
.acc-links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.mine { margin: 16px 0 0; padding: 0; list-style: none; }
.mine-row { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.mine-row img, .mine-row .ph { flex: 0 0 96px; width: 96px; height: 72px; object-fit: cover; border-radius: 14px; background: #ECEEF2; }
.mine-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mine-title { font-weight: 600; text-decoration: none; }
.mine-meta { font-size: 16px; color: var(--muted); }
.mine-acts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.mine-acts .chip { min-height: 40px; font-size: 15px; }
.acc-out { margin-top: 40px; }
