/* Spotted — mobile-first, light/dark */
:root {
  --accent: #e91e63;
  --accent-2: #9c27b0;
  --grad: linear-gradient(135deg, #e91e63, #9c27b0);
  --bg: #f6f5f8;
  --surface: #ffffff;
  --text: #17131c;
  --text-2: #6d6577;
  --line: #e8e4ee;
  --danger: #d32f2f;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(20, 10, 30, .07), 0 6px 24px rgba(20, 10, 30, .05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111014;
    --surface: #1c1a21;
    --text: #f3f0f7;
    --text-2: #a49bb0;
    --line: #2c2933;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font: inherit; color: var(--text); }
a { color: var(--accent); }
img { max-width: 100%; }

#app { max-width: 640px; margin: 0 auto; padding-bottom: calc(24px + var(--safe-bottom)); }

/* ---------- Nagłówek ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: calc(10px + var(--safe-top)) 16px 8px;
  display: flex; align-items: center; gap: 10px;
}
.logo {
  font-weight: 800; font-size: 22px; letter-spacing: -.5px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  cursor: pointer; user-select: none;
}
.city-btn {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
  max-width: 55%; white-space: nowrap; overflow: hidden;
}
.city-btn span { overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 17px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* ---------- Wyszukiwarka + kategorie ---------- */
.searchbar { padding: 4px 16px 0; }
.searchbar input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); padding: 10px 14px; font-size: 15px; outline: none;
}
.searchbar input:focus { border-color: var(--accent); }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
}
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Karty postów ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; border: 1px solid var(--line);
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.cat-badge {
  font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.card-head .dot::before { content: "·"; margin: 0 2px; }
.card-nick { font-weight: 700; color: var(--text); }
.verified { color: var(--accent); font-size: 12px; font-weight: 800; }
.icon-btn.logged { border-color: var(--accent); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.card-content { white-space: pre-wrap; word-break: break-word; font-size: 15.5px; }
.card-content.clamp { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.card-img { margin-top: 10px; border-radius: 12px; width: 100%; max-height: 420px; object-fit: cover; cursor: pointer; }
.img-grid { display: grid; gap: 6px; margin-top: 10px; grid-template-columns: 1fr 1fr; }
.img-grid img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.img-grid.n3 img:first-child { grid-column: 1 / -1; height: 200px; }
.card-content a { word-break: break-all; }
.card-actions { display: flex; gap: 4px; margin-top: 10px; align-items: center; }
.act {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
}
.act:active { background: color-mix(in srgb, var(--text) 8%, transparent); }
.act.liked { color: var(--accent); }
.act .heart { transition: transform .15s; }
.act.liked .heart { transform: scale(1.15); }
.act-spacer { margin-left: auto; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 18px; bottom: calc(20px + var(--safe-bottom)); z-index: 25;
  width: 58px; height: 58px; border-radius: 999px; background: var(--grad); color: #fff;
  font-size: 26px; display: grid; place-items: center;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}
@media (min-width: 700px) { .fab { right: calc(50% - 320px + 18px); } }

/* ---------- Ekrany / modale ---------- */
.screen { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; }
.screen-inner { max-width: 640px; margin: 0 auto; padding: calc(10px + var(--safe-top)) 16px calc(24px + var(--safe-bottom)); }
.screen-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; position: sticky; top: 0; background: var(--bg); z-index: 5; padding-top: 4px; }
.screen-head h2 { font-size: 19px; flex: 1; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 5, 20, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--surface); width: 100%; max-width: 640px;
  border-radius: 20px 20px 0 0; padding: 18px 18px calc(20px + var(--safe-bottom));
  max-height: 88dvh; overflow-y: auto; animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet h3 { margin-bottom: 12px; font-size: 17px; }

/* ---------- Formularze ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 11px 13px; font-size: 15px; outline: none;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.counter { text-align: right; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 15px;
  border-radius: 12px; padding: 13px 18px; width: 100%;
}
.btn:disabled { opacity: .55; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cat-tile {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left;
  background: var(--bg); font-size: 14px; font-weight: 600;
}
.cat-tile.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.cat-tile small { display: block; font-weight: 400; color: var(--text-2); font-size: 11.5px; margin-top: 2px; }
.attach-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.attach-thumb { position: relative; }
.attach-thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; display: block; }
.attach-thumb button { position: absolute; top: -6px; right: -6px; background: rgba(0,0,0,.7); color: #fff; border-radius: 999px; width: 22px; height: 22px; font-size: 11px; }

/* ---------- Lista miast ---------- */
.city-list { display: flex; flex-direction: column; }
.city-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 6px; border-bottom: 1px solid var(--line); font-size: 15.5px; text-align: left; width: 100%;
}
.city-item small { color: var(--text-2); }
.city-item strong { font-weight: 600; }

/* ---------- Komentarze ---------- */
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment .meta { font-size: 12.5px; color: var(--text-2); margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.comment .meta b { color: var(--text); }
.comment p { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 8px; margin-top: 14px; position: sticky; bottom: calc(8px + var(--safe-bottom)); }
.comment-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  padding: 11px 16px; font-size: 14.5px; outline: none;
}
.comment-form button { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 17px; }

/* ---------- Stany ---------- */
.empty { text-align: center; color: var(--text-2); padding: 48px 24px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.spinner { margin: 28px auto; width: 28px; height: 28px; border-radius: 999px; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-bottom)); z-index: 90;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: 88vw; text-align: center;
  animation: up .2s ease;
}

/* ---------- Onboarding ---------- */
.onboard { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; max-width: 480px; margin: 0 auto; }
.onboard .logo-big {
  font-size: 44px; font-weight: 800; letter-spacing: -1px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.onboard p { color: var(--text-2); margin: 10px 0 28px; font-size: 16px; }

/* ---------- Detal ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 96vw; max-height: 92dvh; object-fit: contain; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 64px; color: #fff; font-size: 34px; font-weight: 700;
  background: rgba(255,255,255,.12); border-radius: 12px;
}
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 4px 12px; border-radius: 999px; }

/* ---------- Narzędzia feedu ---------- */
.feed-tools { padding: 0 16px 10px; display: flex; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.active { background: var(--grad); color: #fff; }
.mine-bar { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.mine-bar button { color: var(--accent); font-size: 13px; font-weight: 600; }

.footer-links { text-align: center; font-size: 12.5px; color: var(--text-2); padding: 18px 16px 4px; }
.footer-links a { color: var(--text-2); margin: 0 6px; }
.linklike { color: var(--accent); font-size: 13.5px; font-weight: 700; padding: 4px 8px; margin-bottom: 6px; }

/* ---------- Baner pobierania ---------- */
.dl-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 16px 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); font-size: 13.5px;
}
.dl-banner > span { flex: 1; }
.dl-get {
  flex: 0 0 auto; background: var(--grad); color: #fff; font-weight: 700;
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
}
.dl-close { flex: 0 0 auto; color: var(--text-2); font-size: 14px; padding: 4px 6px; }

/* ---------- Promowane wpisy ---------- */
.card.promoted {
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 2px 14px color-mix(in srgb, var(--accent) 18%, transparent);
}
.promo-badge {
  display: inline-block; margin-bottom: 8px;
  background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .3px;
  padding: 3px 10px; border-radius: 999px;
}
.act.promote { color: var(--accent); }
.promo-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.promo-tier {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg);
  padding: 12px 13px; text-align: left; font-size: 14.5px; cursor: pointer;
}
.promo-tier small { color: var(--text-2); font-size: 12px; }
.promo-tier .promo-price { margin-top: 4px; font-weight: 800; color: var(--accent); }
.promo-tier.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }

/* ---------- Powiadomienia ---------- */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 800; border-radius: 999px;
  place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.notif-item {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 10px 12px; cursor: pointer; font-size: 13.5px;
}
.notif-item.unread { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.notif-line { color: var(--text); }
.notif-comment { color: var(--text); font-weight: 600; }
.notif-post { color: var(--text-2); font-size: 12.5px; }
.notif-time { color: var(--text-2); font-size: 11.5px; }
