/* Forum Informatyków Samorządowych – prosty, czytelny wygląd */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7e;
  --line: #e2e7ee;
  --brand: #1f4e8c;
  --brand-dark: #163a6a;
  --brand-soft: #e8f0fb;
  --ok: #1d7a46;
  --ok-soft: #e6f5ec;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-soft: #fff6dc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 1px 8px rgba(16, 30, 54, .04);
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2em 0 .5em; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 1.2em 0 .5em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: #fff; padding: 8px 12px; }

/* Nagłówek */
.top { background: var(--brand); color: #fff; margin-bottom: 24px; }
.top-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: .78rem; opacity: .85; }
.logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #fff; color: var(--brand); font-weight: 800; letter-spacing: -.5px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav a, .nav .linklike { color: #fff; font-weight: 500; }
.nav .me { background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 99px; }
.nav form { margin: 0; }
.search input { border: 0; border-radius: 99px; padding: 7px 14px; width: 210px; font: inherit; font-size: .9rem; }

/* Karty */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { padding: 14px 22px; margin: 0; border-bottom: 1px solid var(--line); background: #fafbfd; font-size: 1.05rem; }
.pad { padding: 16px 22px; margin: 0; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.narrow-wide { max-width: 860px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* Kategorie */
.cats, .threads { list-style: none; margin: 0; padding: 0; }
.cats li, .trow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 230px; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); align-items: center; }
.cats li:last-child, .trow:last-child { border-bottom: 0; }
.ctitle { font-weight: 650; font-size: 1.05rem; }
.cmain p { margin: 2px 0 0; font-size: .9rem; }
.cstat, .tstat { font-size: .88rem; text-align: center; }
.clast, .tlast { font-size: .85rem; }
@media (max-width: 700px) {
  .cats li, .trow { grid-template-columns: 1fr; gap: 4px; }
  .cstat, .tstat { text-align: left; }
}
.ttitle { font-weight: 600; }
.trow.pinned { background: #fbfcff; }
.meta { font-size: .82rem; color: var(--muted); margin-top: 2px; }

.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); vertical-align: middle; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-lock { background: #eceff3; color: #4a5568; }
.tag-pin { background: var(--warn-soft); color: #7a5b00; }

/* Rangi */
.rank { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap; }
.r0 { background: #f1f3f5; color: #556; border-color: #dde1e6; }
.r1 { background: #e7f4ff; color: #135; border-color: #c7e2fb; }
.r2 { background: #e6f5ec; color: #14532d; border-color: #c3e6d1; }
.r3 { background: #fff3d6; color: #7a4a00; border-color: #f5dc9c; }
.r4 { background: #fde8e4; color: #8a1c0e; border-color: #f7c6bc; }
.r5 { background: linear-gradient(90deg, #2a1f6e, #6d28d9); color: #fff; }
.role { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--brand); color: #fff; }
.role-moderator { background: #0f766e; }

/* Posty */
.post { display: grid; grid-template-columns: 190px minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; scroll-margin-top: 16px; }
.post:target { outline: 3px solid #f0b429; }
.post.is-solution { border: 2px solid var(--ok); }
.author { padding: 16px; border-right: 1px solid var(--line); background: #fafbfd; border-radius: var(--radius) 0 0 var(--radius); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.aname { font-weight: 700; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.avatar.big { width: 72px; height: 72px; font-size: 1.8rem; flex: none; }
.pbody { padding: 14px 20px; display: flex; flex-direction: column; min-width: 0; }
.phead { display: flex; gap: 10px; align-items: center; font-size: .85rem; margin-bottom: 6px; flex-wrap: wrap; }
.content { overflow-wrap: anywhere; }
.content p { margin: 0 0 .8em; }
.content code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.content pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .85rem; }
.content pre code { background: none; padding: 0; color: inherit; }
.pactions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.pactions form { margin: 0; }
.spacer { flex: 1; }
.likes { font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) {
  .post { grid-template-columns: 1fr; }
  .author { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; border-radius: var(--radius) var(--radius) 0 0; }
  .avatar { width: 32px; height: 32px; font-size: .9rem; }
}
.solution-box { display: block; background: var(--ok-soft); border: 1px solid #b7e0c6; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; color: var(--text); }
.solution-box strong { color: var(--ok); }
.solution-box em { display: block; font-style: normal; color: var(--ok); font-size: .9rem; margin-top: 4px; }
.modbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--warn-soft); border: 1px solid #f2e2a8; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 14px; }
.modbar form { margin: 0; }

/* Przyciski i formularze */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 8px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-small { padding: 4px 11px; font-size: .85rem; }
.btn-big { padding: 12px 26px; font-size: 1.05rem; }
.btn-ghost { background: #fff; color: var(--brand); border-color: #c9d6e8; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-on { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.btn-on:hover { background: #d8e6f8; }
.btn-on-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: #efc2bd; }
.btn-danger:hover { background: var(--danger-soft); }
.top .btn { background: #fff; color: var(--brand); border-color: #fff; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.danger { color: var(--danger); }
.form label { display: block; font-weight: 600; margin-bottom: 14px; }
.form label .muted { font-weight: 400; font-size: .85rem; }
.form input:not([type=checkbox]), .form textarea, .form select, .inline input, select, .table input {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; font-weight: 400;
  border: 1px solid #c8d1dc; border-radius: 8px; background: #fff; color: var(--text);
}
.table input { margin: 0; padding: 5px 8px; font-size: .9rem; }
.table input.tiny { width: 70px; }
.form textarea { resize: vertical; min-height: 120px; }
.form .check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.form .check input { width: 18px; height: 18px; }
.form.row, .searchbig { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form.row input, .searchbig input { flex: 1; min-width: 180px; margin: 0; }
.searchbig { margin-bottom: 16px; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline input, .inline select { width: auto; max-width: 100%; margin: 0; padding: 4px 8px; font-size: .88rem; }
.actions { display: flex; gap: 16px; align-items: center; }
.help { font-size: .88rem; margin: -6px 0 14px; color: var(--muted); }
.help summary { cursor: pointer; }
.help .warn { background: var(--warn-soft); padding: 6px 10px; border-radius: 6px; color: #6b5000; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; background: var(--brand-soft); border: 1px solid #c9daf2; }
.flash ul { margin: 0; padding-left: 20px; }
.flash-success { background: var(--ok-soft); border-color: #b7e0c6; }
.flash-error { background: var(--danger-soft); border-color: #f2c4bf; color: #7d1a14; }

/* Listy, tabele */
ul.plain, ol.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li, ol.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child, ol.plain li:last-child { border-bottom: 0; }
ol.toplist { counter-reset: t; }
ol.toplist li { counter-increment: t; }
ol.toplist li::before { content: counter(t) "."; color: var(--muted); margin-right: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfd; }
.table .num { text-align: right; }
.table.compact td { padding: 6px 4px; }
.table-scroll { overflow-x: auto; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.count { background: var(--danger); color: #fff; border-radius: 99px; padding: 0 9px; font-size: .8rem; vertical-align: middle; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.pages { display: flex; gap: 6px; justify-content: center; margin: 10px 0 20px; flex-wrap: wrap; }
.pages a, .pages span { padding: 5px 11px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.pages .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.stats dl, .stats4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.stats4 { grid-template-columns: repeat(4, 1fr); margin-top: 18px; }
.stats dl div, .stats4 div { background: #f6f8fb; border-radius: 8px; padding: 10px; text-align: center; }
dt { font-size: .8rem; color: var(--muted); }
dd { margin: 0; font-size: 1.4rem; font-weight: 700; }
@media (max-width: 600px) { .stats4 { grid-template-columns: 1fr 1fr; } }

.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
.profile-head h1 { margin: 0 0 4px; }
.profile-head p { margin: 6px 0 0; }
.progress-wrap { margin-top: 14px; }
.progress { width: 100%; height: 12px; accent-color: var(--brand); }
.ranks li { display: flex; justify-content: space-between; }

.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 2.3rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 700px; margin: 0 auto 24px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.prose li { margin-bottom: 8px; }
.temp-pass code { font-size: 1.4rem; background: #eef1f5; padding: 8px 14px; border-radius: 8px; user-select: all; }
.foot { color: var(--muted); font-size: .85rem; padding-top: 10px; padding-bottom: 30px; text-align: center; }

@media (max-width: 700px) {
  html { font-size: 16px; }
  .top-inner { gap: 10px; }
  .brand small { display: none; }
  .nav { margin-left: 0; width: 100%; gap: 12px; }
  .search { order: 10; width: 100%; }
  .search input { width: 100%; }
  .modbar .inline { flex-wrap: wrap; }
  .modbar select { max-width: 220px; }
  h1 { font-size: 1.35rem; }
}
