:root {
  --bg: #fbf7f2; --card: #fff; --ink: #2b2320; --muted: #8a7f78; --line: #efe6dd;
  --accent: #f2994a; --accent-ink: #b85d12; --soft: #fff1e4; --good: #2f9e6e; --bad: #d64545;
  --r: 16px; --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .05);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1 { font-size: 26px; margin: 4px 0 6px; } h2 { margin: 0 0 12px; } h3 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); } .small, small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--accent-ink); }
.logo img { width: 34px; height: 34px; }
.top-search { flex: 1; max-width: 420px; }
.top-search input { width: 100%; border-radius: 999px; background: var(--bg); }
.top-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.city-select { width: auto; border-radius: 999px; }

/* раскладка */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; max-width: 1180px; margin: 0 auto; padding: 20px; }
.side { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.side a i { font-style: normal; font-size: 18px; width: 24px; text-align: center; }
.side a:hover { background: var(--soft); color: var(--ink); }
.side a.on { background: var(--card); box-shadow: var(--shadow); color: var(--accent-ink); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.head h2 { margin: 0; }
.section { margin: 22px 0 10px; }

/* карточки */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.empty { text-align: center; padding: 36px 16px; }
.hero { background: linear-gradient(135deg, #fff1e4, #ffe0c2); }
.hero h1 { font-size: 30px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 160px; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; }
a.li:hover { background: var(--soft); }
.li.on { background: var(--soft); }

.ava { display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; }
.ava.pet, .ava.place { color: initial; border-radius: 30%; }
.ava.group { border-radius: 22%; color: var(--ink); }
.tick { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #3b82f6; color: #fff; font-size: 10px; vertical-align: 1px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.st-breeder { background: #f3e8ff; color: #7c3aed; } .st-shelter { background: #e6f6ee; color: var(--good); }
.st-vet { background: #e7f0ff; color: #2563eb; } .st-business { background: #fff4d6; color: #a16207; }
.cat-lost { background: #fde8e8; color: var(--bad); } .cat-found { background: #e6f6ee; color: var(--good); } .cat-adopt { background: #e7f0ff; color: #2563eb; }

/* формы */
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f2994a55; border-color: var(--accent); }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--ink); font-weight: 400; }
.form { max-width: 620px; } .auth { max-width: 400px; margin: 30px auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: #e3822c; color: #fff; }
.btn.ghost { background: var(--soft); color: var(--accent-ink); }
.btn.danger { background: #fde8e8; color: var(--bad); }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon { border: 0; background: none; cursor: pointer; font-size: 18px; padding: 4px; }
.upload { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--accent-ink); }
.upload input[type=file] { display: none; }
.upload span { padding: 8px 14px; border-radius: 999px; background: var(--soft); }
.upload .preview { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.upload.busy span::after { content: ' …'; }

/* посты */
.composer textarea { border: 0; background: var(--bg); }
.composer select { width: auto; }
.post header { display: flex; gap: 10px; align-items: flex-start; }
.post .who { flex: 1; }
.post .text { white-space: pre-wrap; margin: 12px 0; }
.post-img { display: block; width: calc(100% + 32px); margin: 8px -16px; max-height: 560px; object-fit: cover; }
.post footer { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.react { border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; color: var(--muted); }
.react:hover, .react.on { background: var(--soft); color: var(--accent-ink); }
.comments { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.comment { display: flex; gap: 8px; margin-bottom: 8px; }
.comments form input { flex: 1; width: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button, .pills a { border: 0; background: var(--card); box-shadow: var(--shadow); padding: 7px 14px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.on, .pills a.on { background: var(--ink); color: #fff; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.pills.small a { padding: 4px 12px; font-size: 13px; }

/* профили и сетки */
.profile { display: flex; gap: 20px; align-items: flex-start; }
.profile .row { margin-top: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts span { background: var(--bg); padding: 3px 10px; border-radius: 999px; font-size: 14px; }
.members { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid.pets { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 0; }
.tile.wide { align-items: flex-start; text-align: left; }
.tile p { margin: 4px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; } .filters input { flex: 2 1 220px; width: auto; } .filters select { flex: 1 1 150px; width: auto; }
.ad { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0; }
.ad > img, .ad-ph { width: 100%; height: 150px; object-fit: cover; }
.ad-ph { display: grid; place-items: center; font-size: 48px; background: var(--soft); }
.ad > div { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.price { font-weight: 800; color: var(--accent-ink); } .price.big { font-size: 22px; }
.ad-full { max-width: 720px; } .ad-full > img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.ad-full .text { white-space: pre-wrap; }
.stars { color: #f5a623; letter-spacing: 1px; }
.place .score { text-align: right; white-space: nowrap; }
.rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; margin: 8px 0; }
.rate input { display: none; }
.rate label { font-size: 30px; color: #ddd; cursor: pointer; margin: 0 2px 0 0; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: #f5a623; }
.review p { margin: 8px 0 0; white-space: pre-wrap; }

/* сообщения */
.chat-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 120px); }
.convs { overflow-y: auto; margin: 0; }
.chat { display: flex; flex-direction: column; margin: 0; min-height: 0; }
.chat.empty { justify-content: center; }
.chat header { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 2px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--bg); white-space: pre-wrap; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg small { display: block; font-size: 11px; opacity: .65; text-align: right; }
.chat form input { flex: 1; width: auto; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.badge[hidden] { display: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 50; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); }

/* мобильная версия */
@media (max-width: 980px) { .cols { grid-template-columns: 1fr; } .cols aside { display: none; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 12px 12px 80px; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 20; flex-direction: row; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 4px; }
  .side a { flex-direction: column; gap: 0; padding: 6px 4px; font-size: 10px; position: relative; }
  .side a .badge { position: absolute; top: 0; right: 0; }
  .top { padding: 8px 12px; gap: 8px; } .logo span, .hide-sm, .top-search { display: none; }
  .city-select { flex: 1; }
  .profile { flex-direction: column; align-items: center; text-align: center; } .profile .row, .facts { justify-content: center; }
  .cols.even, .chat-wrap { grid-template-columns: 1fr; } .chat-wrap { height: auto; } .chat { height: 70vh; }
  .filters { flex-wrap: wrap; } .filters select { width: 100%; }
}
.stars .half { background: linear-gradient(90deg, #f5a623 50%, #ddd 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lang { max-width: 130px; }
.facts a span:hover { background: var(--soft); }

.social { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 4px; }
.btn.apple { background: #000; color: #fff; max-width: 300px; }
.btn.apple:hover { background: #222; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 12px 0; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.notice { background: #fff8e6; border: 1px solid #f5d98a; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
