/* =========================================================
   AI FORUM — system stylów (jasny, nowoczesny "2030")
   Jeden plik współdzielony przez wszystkie podstrony.
   Konwencja: zmienne CSS + komponenty + utilities.
   ========================================================= */

/* ---------- 1. Zmienne / design tokens ---------- */
:root {
  /* Kolory bazowe (jasny motyw) */
  --bg:            #f6f7fb;
  --bg-grad-1:     #eef1ff;
  --bg-grad-2:     #f6f7fb;
  --surface:       #ffffff;
  --surface-2:     #fbfbfe;
  --border:        #e7e9f2;
  --border-strong: #d7dae8;

  /* Tekst */
  --text:          #161a2b;
  --text-soft:     #475067;
  --text-muted:    #8a92a8;

  /* Akcent (indygo → fiolet) */
  --accent:        #5b62f4;
  --accent-2:      #8b5cf6;
  --accent-ink:    #4b50d6;
  --accent-soft:   #eef0ff;
  --accent-grad:   linear-gradient(135deg, #5b62f4 0%, #8b5cf6 100%);

  /* Stany */
  --green:         #18b368;
  --amber:         #f59e0b;
  --pink:          #ec4899;
  --cyan:          #06b6d4;

  /* Promienie i cienie */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(22,26,43,.05), 0 1px 3px rgba(22,26,43,.04);
  --shadow:    0 4px 16px rgba(28,33,64,.07);
  --shadow-lg: 0 18px 50px rgba(28,33,64,.13);

  /* Typografia / odstępy */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --container: 1120px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 85% -10%, var(--bg-grad-1), transparent 60%),
    radial-gradient(900px 500px at 0% -5%, #f0eaff, transparent 55%);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; letter-spacing: -.015em; }

/* ---------- 3. Layout pomocniczy ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.row    { display: flex; }
.between{ justify-content: space-between; }
.center { align-items: center; }
.wrap   { flex-wrap: wrap; }
.gap-sm { gap: 8px; }  .gap { gap: 16px; }  .gap-lg { gap: 24px; }
.muted  { color: var(--text-muted); }
.soft   { color: var(--text-soft); }
.grow   { flex: 1; }
.hide-mobile { }

/* Główna siatka treść + sidebar */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
  padding: 28px 0 56px;
}
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .layout > * { min-width: 0; }            /* pozwól kolumnom się kurczyć (bez overflow) */
  aside.sidebar { order: 2; position: static; top: auto; }  /* sidebar POD treścią, nie nachodzi */
}

/* ---------- 4. Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--accent-grad);
  display: grid; place-items: center; color: #fff; font-weight: 800;
  box-shadow: 0 6px 16px rgba(91,98,244,.4);
}
.brand b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav-links a {
  padding: 8px 13px; border-radius: 10px; color: var(--text-soft);
  font-weight: 600; font-size: 14px; transition: .15s;
}
.nav-links a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav-links a.active { color: var(--accent-ink); background: var(--accent-soft); }

.search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 340px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; color: var(--text-muted);
  transition: .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 14px; color: var(--text); }
.search svg { flex: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: 11px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 8px 20px rgba(91,98,244,.32); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.burger { display: none; background: var(--surface); border: 1px solid var(--border-strong);
  width: 40px; height: 40px; border-radius: 11px; place-items: center; }
.burger span, .burger span::before, .burger span::after {
  content: ''; display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative;
}
.burger span::before { position: absolute; top: -6px; } .burger span::after { position: absolute; top: 6px; }

@media (max-width: 820px) {
  .nav-links, .search { display: none; }
  .burger { display: grid; }
  .nav-links.open {
    display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; gap: 4px;
  }
  .nav-links.open a { width: 100%; }
}

/* ---------- 5. Hero (strona główna) ---------- */
.hero {
  margin-top: 26px; padding: 34px 34px 30px;
  background: linear-gradient(120deg, #ffffff 0%, #f3f1ff 100%);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(139,92,246,.18), transparent 65%); pointer-events: none;
}
.hero h1 { font-size: 34px; font-weight: 800; max-width: 620px; }
.hero p { color: var(--text-soft); max-width: 560px; margin: 12px 0 22px; font-size: 16px; }
.hero .stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero .stats .n { font-size: 24px; font-weight: 800; }
.hero .stats small { color: var(--text-muted); font-weight: 600; }
.hero .stats b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 6. Sekcje / nagłówki ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 16px; }
.section-head h2 { font-size: 20px; font-weight: 800; }
.section-head a { font-weight: 700; color: var(--accent-ink); font-size: 14px; }

/* ---------- 7. Karty działów (grid) ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 940px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow-sm); transition: .18s; position: relative; overflow: hidden;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.cat-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; margin-bottom: 12px; color: #fff;
}
.cat-card h3 { font-size: 16px; font-weight: 800; }
.cat-card p { color: var(--text-muted); font-size: 13px; margin: 5px 0 14px; min-height: 34px; }
.cat-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; border-top: 1px solid var(--border); padding-top: 11px; }
.cat-meta b { color: var(--text); }

/* ---------- 7b. Bloki działów: nagłówek na górze + 3 wątki poniżej ---------- */
.cat-board { display: flex; flex-direction: column; gap: 16px; }
.cat-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: .18s;
}
.cat-block:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }

/* Nagłówek działu — poziomy pasek (CAŁY klikalny) */
a.cb-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  transition: .15s;
}
a.cb-head:hover { background: var(--accent-soft); }
.cat-block .cb-head .cat-ico { width: 42px; height: 42px; font-size: 21px; margin: 0; flex: none; transition: .15s; }
a.cb-head:hover .cat-ico { transform: scale(1.05); }

/* Tytuł sugerujący kliknięcie: kolor akcentu + strzałka */
.cat-block .cb-head .cb-title h3 {
  font-size: 16px; font-weight: 800; color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 7px;
}
.cat-block .cb-head .cb-title h3 .arr { transition: transform .18s; font-size: 15px; }
a.cb-head:hover .cb-title h3 { color: var(--accent); }
a.cb-head:hover .cb-title h3 .arr { transform: translateX(4px); }
.cat-block .cb-head .cb-title p { color: var(--text-muted); font-size: 12.5px; margin: 2px 0 0; }

/* Statystyki po prawej */
.cat-block .cb-head .cb-stats { margin-left: auto; display: flex; gap: 18px; text-align: right; align-items: center; }
.cat-block .cb-head .cb-stats span { font-size: 11.5px; color: var(--text-muted); font-weight: 600; line-height: 1.3; }
.cat-block .cb-head .cb-stats b { color: var(--text); display: block; font-size: 14px; }

/* Lista 3 wątków — pełna szerokość */
.cat-block .cb-feed { display: flex; flex-direction: column; }
.cb-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); transition: .14s; }
.cb-item:last-child { border-bottom: 0; }
.cb-item:hover { background: var(--surface-2); }
.cb-item .it-ttl { font-weight: 600; font-size: 13.5px; color: var(--text-soft); display: block; }
.cb-item .it-ttl:hover { color: var(--accent-ink); }
.cb-item .it-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.cb-item .it-num { display: flex; flex-direction: column; align-items: center; min-width: 42px; }
.cb-item .it-num b { font-weight: 700; font-size: 14px; }
.cb-item .it-num small { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

@media (max-width: 560px) {
  .cat-block .cb-head .cb-stats span:not(.cb-more) { display: none; }
}
@media (max-width: 420px) { .cb-item .it-num { display: none; } }

/* Kolory ikon działów (klasy modyfikujące) */
.ico-home  { background: linear-gradient(135deg,#f97316,#fb923c); }
.ico-sport { background: linear-gradient(135deg,#16a34a,#22c55e); }
.ico-moto  { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }
.ico-health{ background: linear-gradient(135deg,#ec4899,#f472b6); }
.ico-tech  { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.ico-money { background: linear-gradient(135deg,#0d9488,#14b8a6); }
.ico-food  { background: linear-gradient(135deg,#ef4444,#f87171); }
.ico-travel{ background: linear-gradient(135deg,#a855f7,#c084fc); }
.ico-other { background: linear-gradient(135deg,#64748b,#94a3b8); }
.ico-biznes{ background: linear-gradient(135deg,#1e3a8a,#2563eb); }

/* ---------- 8. Lista wątków ---------- */
.threads { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.thread-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border); transition: .14s;
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--surface-2); }
.thread-row .av { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); }
.thread-row .ttl { font-weight: 700; font-size: 15px; color: var(--text); display: block; }
.thread-row .ttl:hover { color: var(--accent-ink); }
.thread-row .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thread-row .nums { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.thread-row .nums .big { font-weight: 800; font-size: 15px; }
.thread-row .nums small { color: var(--text-muted); font-size: 11.5px; }
@media (max-width: 560px) { .thread-row .nums { display: none; } }

/* Pigułka tagu działu */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.hot { background: #fff1ef; color: #ef4444; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); display: inline-block; }

/* ---------- 9. Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 18px;
}
.card h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin-bottom: 14px; }
.mini-user { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mini-user:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-user img { width: 38px; height: 38px; border-radius: 11px; }
.mini-user .nick { font-weight: 700; font-size: 14px; }
.mini-user .meta { font-size: 12px; color: var(--text-muted); }
.online { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(24,179,104,.18); margin-left: auto; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { padding: 6px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-soft); transition: .14s; }
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

.promo { background: var(--accent-grad); color: #fff; border: 0; }
.promo h3 { color: rgba(255,255,255,.85); }
.promo p { font-size: 13.5px; color: rgba(255,255,255,.9); margin: 0 0 14px; }
.promo .btn { background: #fff; color: var(--accent-ink); width: 100%; }

/* ---------- 10. Breadcrumb ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); padding: 20px 0 0; flex-wrap: wrap; }
.crumbs a { font-weight: 600; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs .sep { opacity: .5; }

/* ---------- 11. Nagłówek kategorii ---------- */
.cat-header {
  display: flex; gap: 18px; align-items: center; margin: 16px 0 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 22px;
}
.cat-header .cat-ico { width: 58px; height: 58px; font-size: 28px; margin: 0; flex: none; }
.cat-header h1 { font-size: 24px; font-weight: 800; }
.cat-header p { color: var(--text-soft); margin: 5px 0 0; font-size: 14.5px; }
.cat-header .hstats { margin-left: auto; text-align: right; }
.cat-header .hstats .n { font-size: 22px; font-weight: 800; }
.cat-header .hstats small { color: var(--text-muted); }
@media (max-width: 600px) { .cat-header .hstats { display: none; } }

/* Pasek filtrów/sortowania */
.toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-soft); transition: .14s; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.active { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ---------- 12. Paginacja ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 26px 0 0; }
.pager a, .pager span {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--text-soft);
}
.pager a:hover { border-color: var(--accent); color: var(--accent-ink); }
.pager .cur { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ---------- 13. Widok wątku ---------- */
.thread-head { margin: 14px 0 6px; }
.thread-head h1 { font-size: 26px; font-weight: 800; max-width: 760px; }
.thread-head .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; margin-top: 12px; }

.post {
  display: grid; grid-template-columns: 200px 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 16px;
}
.post.op { border-color: #d9d2ff; box-shadow: 0 6px 24px rgba(91,98,244,.1); }
.post .author {
  background: var(--surface-2); border-right: 1px solid var(--border); padding: 22px 18px; text-align: center;
}
.post.op .author { background: linear-gradient(180deg,#f4f2ff,#fbfbfe); }
.post .author img { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 12px; box-shadow: var(--shadow); }
.post .author .nick { font-weight: 800; font-size: 15px; }
.post .author .nick:hover { color: var(--accent-ink); }
.post .author .role { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; display: inline-block; margin-top: 6px; }
.post .author .sig { font-size: 12px; color: var(--text-muted); margin-top: 12px; font-style: italic; line-height: 1.4; }
.post .author .ustats { font-size: 12px; color: var(--text-soft); margin-top: 12px; display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--border); padding-top: 12px; }
.post .author .ustats b { color: var(--text); }

.post .body { padding: 20px 24px; display: flex; flex-direction: column; }
.post .body .top { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 12.5px; margin-bottom: 12px; }
.post .content { font-size: 15px; color: var(--text); line-height: 1.65; }
.post .content p { margin: 0 0 12px; }
.post .content p:last-child { margin-bottom: 0; }
.post .content a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.post .actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-soft); transition: .14s; }
.act:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.act.liked { color: var(--pink); border-color: #f9c8e0; background: #fff1f8; }

@media (max-width: 680px) {
  .post { grid-template-columns: 1fr; }
  .post .author { display: flex; align-items: center; gap: 14px; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 18px; }
  .post .author img { width: 48px; height: 48px; margin: 0; }
  .post .author .sig, .post .author .ustats { display: none; }
}

/* Box odpowiedzi (dekoracyjny) */
.reply-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px; margin-top: 8px; }
.reply-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.reply-box textarea { width: 100%; min-height: 110px; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 13px 15px; font-family: inherit; font-size: 14.5px; resize: vertical; outline: 0; transition: .15s; background: var(--surface-2); }
.reply-box textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.reply-box .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* ---------- 14. Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer .container { padding: 40px 20px 30px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr; gap: 30px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer ul a { color: var(--text-soft); font-size: 14px; font-weight: 500; }
.footer ul a:hover { color: var(--accent-ink); }
.footer .about p { color: var(--text-muted); font-size: 13.5px; max-width: 320px; margin: 12px 0 0; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--text-muted); font-size: 13px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 14b. Profil użytkownika ---------- */
.profile-head {
  display: flex; gap: 22px; align-items: center; margin: 16px 0 0;
  background: linear-gradient(120deg,#ffffff 0%, #f3f1ff 100%);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow); padding: 26px; position: relative; overflow: hidden;
}
.profile-head::after {
  content: ''; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(139,92,246,.16), transparent 65%); pointer-events: none;
}
.profile-head .pf-av {
  width: 104px; height: 104px; border-radius: 26px; flex: none;
  box-shadow: var(--shadow-lg); border: 3px solid #fff;
}
.profile-head .pf-info { flex: 1; min-width: 0; }
.profile-head .pf-info h1 { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-head .pf-info .sig { color: var(--text-soft); font-style: italic; margin: 6px 0 12px; font-size: 14px; }
.profile-head .pf-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.profile-head .pf-meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-head .pf-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
@media (max-width: 640px) {
  .profile-head { flex-direction: column; text-align: center; }
  .profile-head .pf-meta { justify-content: center; }
  .profile-head .pf-actions { flex-direction: row; width: 100%; }
  .profile-head .pf-actions .btn { flex: 1; }
}

/* Pasek statystyk profilu */
.pf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 8px; }
.pf-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 16px; text-align: center; }
.pf-stat .n { font-size: 22px; font-weight: 800; }
.pf-stat .n b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pf-stat small { color: var(--text-muted); font-weight: 600; font-size: 12.5px; }
@media (max-width: 560px) { .pf-stats { grid-template-columns: repeat(2, 1fr); } }

/* Zakładki */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 22px 0 16px; }
.tabs button { background: none; border: 0; padding: 11px 16px; font-size: 14px; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .14s; }
.tabs button:hover { color: var(--accent-ink); }
.tabs button.active { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* Lista aktywności (posty użytkownika w kontekście wątków) */
.activity { display: flex; flex-direction: column; gap: 12px; }
.act-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 16px 18px; transition: .15s; }
.act-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.act-item .ai-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap; }
.act-item .ai-ttl { font-weight: 700; font-size: 15px; }
.act-item .ai-ttl:hover { color: var(--accent-ink); }
.act-item .ai-snippet { color: var(--text-soft); font-size: 14px; margin-top: 6px; line-height: 1.55; }
.act-item .ai-foot { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); display: flex; gap: 14px; }

/* Karta szczegółów (lista klucz-wartość) */
.kv { display: flex; flex-direction: column; gap: 11px; }
.kv .row2 { display: flex; justify-content: space-between; font-size: 13.5px; }
.kv .row2 span { color: var(--text-muted); }
.kv .row2 b { font-weight: 700; }
.interests { display: flex; flex-wrap: wrap; gap: 8px; }
.interests span { padding: 6px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }

/* Animacja "pyknięcia" licznika Pomocne */
.act.bump { animation: likeBump .28s ease; }
@keyframes likeBump { 0%{transform:scale(1)} 35%{transform:scale(1.14)} 100%{transform:scale(1)} }

/* ---------- 15. Drobiazgi ---------- */
.badge-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
::selection { background: rgba(91,98,244,.22); }

/* ---------- 16. Zabezpieczenie przed poziomym przewijaniem (mobile) ---------- */
body { max-width: 100%; overflow-x: clip; }   /* clip nie psuje sticky navbara (w przeciwieństwie do hidden) */
/* kolumny gridów/flex muszą móc się kurczyć poniżej szerokości treści */
.layout > *, .thread-row > div, .cb-item > div, .post, .post .body, .post .author { min-width: 0; }
/* długie tytuły, treści i linki łamią się zamiast rozpychać layout */
.thread-row .ttl, .cb-item .it-ttl, .act-item .ai-snippet, .act-item .ai-ttl,
.post .content, .thread-head h1, .crumbs { overflow-wrap: anywhere; word-break: break-word; }
/* akcje pod postem zawijają się na wąskim ekranie */
.post .actions { flex-wrap: wrap; }
.act { white-space: nowrap; }

/* ---------- 17. Formularze (rejestracja / logowanie) ---------- */
.auth { max-width: 440px; margin: 40px auto; }
.auth h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth .lead { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text-soft); }
.field input { width: 100%; border: 1px solid var(--border-strong); border-radius: 11px; padding: 11px 14px; font-family: inherit; font-size: 14.5px; outline: 0; background: var(--surface-2); transition: .15s; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.captcha-row { display: flex; align-items: flex-end; gap: 12px; }
.captcha-row .field { flex: 1; margin-bottom: 0; }
.captcha-q { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 11px; font-weight: 800; font-size: 16px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.alert { padding: 12px 15px; border-radius: 11px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.alert.ok { background: #e8f8f0; color: #0d8b4f; }
.alert.err { background: #fdecec; color: #d23b3b; }
.auth .alt { text-align: center; font-size: 13.5px; color: var(--text-muted); margin-top: 16px; }
.auth .alt a { color: var(--accent-ink); font-weight: 700; }

/* ---------- 18. Edycja inline (tylko admin) ---------- */
.post-edit { text-align: right; margin-top: 10px; }
.title-edit { margin-top: 10px; }
.post-edit summary, .title-edit summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 700; color: var(--text-muted); user-select: none;
}
.post-edit summary::-webkit-details-marker, .title-edit summary::-webkit-details-marker { display: none; }
.post-edit summary:hover, .title-edit summary:hover { color: var(--accent-ink); }
.edit-form { text-align: left; margin-top: 10px; }
.edit-form textarea { width: 100%; min-height: 130px; border: 1px solid var(--border-strong); border-radius: 11px; padding: 11px 13px; font-family: inherit; font-size: 14px; line-height: 1.55; outline: 0; resize: vertical; background: var(--surface-2); }
.edit-form input[type=text] { width: 100%; border: 1px solid var(--border-strong); border-radius: 11px; padding: 10px 13px; font-family: inherit; font-size: 15px; font-weight: 700; outline: 0; margin-bottom: 10px; background: var(--surface-2); }
.edit-form textarea:focus, .edit-form input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.edit-form .btn { margin-top: 10px; }

/* Usuwanie wątku z listy (admin) */
.inline-del { display: inline; margin: 0; }
.del-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: #d23b3b; cursor: pointer; }
.del-link:hover { text-decoration: underline; }

/* ---------- 19. Atrakcyjność wątków ---------- */
/* #8 Pasek udostępniania */
.share-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 2px; }
.share-bar .sb-label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.sb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text-soft); cursor: pointer; transition: .14s; }
.sb-btn:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* #1 Najlepsza odpowiedź */
.best-answer { display: block; background: linear-gradient(120deg,#eafaf1,#f3fbf6); border: 1px solid #b9e8cd; border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); transition: .15s; }
.best-answer:hover { box-shadow: var(--shadow); border-color: #8fdcb0; }
.best-answer .ba-head { font-weight: 800; font-size: 14px; color: #0d8b4f; }
.best-answer .ba-head .muted { font-weight: 600; }
.best-answer .ba-snippet { color: var(--text-soft); font-size: 14px; margin: 7px 0 8px; line-height: 1.55; }
.best-answer .ba-go { font-size: 12.5px; font-weight: 700; color: #0d8b4f; }
.post.best { border-color: #9fe3bd; box-shadow: 0 6px 24px rgba(24,179,104,.12); }
.post.best .author { background: linear-gradient(180deg,#f0fbf5,#fbfbfe); }
.best-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: #0d8b4f; background: #e6f8ef; border: 1px solid #b9e8cd; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }

/* ---------- 20. Strona 404 ---------- */
.notfound { text-align: center; max-width: 640px; margin: 36px auto 24px; }
.notfound .nf-code { font-size: 84px; font-weight: 800; line-height: 1; letter-spacing: -.04em; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound h1 { font-size: 26px; font-weight: 800; margin: 8px 0 10px; }
.notfound p { color: var(--text-soft); font-size: 15px; }
