/* =========================================================
   Black – MyBB Theme
   Inspirowany index.php (czerń / szarość / biel)
   Blokowy układ działów + pełna responsywność
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #141416;
  --panel-2: #1a1a1d;
  --line: #2b2b30;
  --line-soft: rgba(255,255,255,.07);
  --text: #e9e9eb;
  --muted: #929298;
  --quiet: #6f6f76;
  --white: #f5f5f6;
  --accent: #e7e7e9;
  --accent-hover: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
  --shadow-soft: 0 8px 30px rgba(0,0,0,.22);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --blue: #7aa2ff;
  --green: #5dcd7a;
  --red: #f07178;
}

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.04), transparent 42rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .18s ease; }
a:hover, a:focus-visible { color: var(--white); }
img { max-width: 100%; height: auto; border: 0; }
:focus-visible { outline: 2px solid #aaaab0; outline-offset: 3px; }

/* ----- Layout ----- */
#container {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 0 0 40px;
}
.wrapper { width: 100%; position: relative; }

/* ----- Header / Topbar ----- */
#header,
.topbar {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
}
.logo a,
.brand {
  text-decoration: none;
  color: #b9b9bd;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .85;
}
.logo a:hover { opacity: 1; color: var(--white); }

/* Welcome / user panel */
.welcome {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .88rem;
  color: var(--muted);
}
.welcome a { color: var(--muted); }
.welcome a:hover { color: var(--white); }
.welcome strong { color: var(--text); font-weight: 600; }

/* Menu */
.menu,
ul.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.menu li,
ul.menu li { display: inline-flex; }
.menu a,
ul.menu a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .88rem;
  transition: background .18s, color .18s;
}
.menu a:hover,
ul.menu a:hover {
  background: rgba(255,255,255,.06);
  color: var(--white);
}
.menu a.menu-logout,
ul.menu a.menu-logout {
  border: 1px solid var(--line);
  color: var(--muted);
  margin-left: 6px;
}
.menu a.menu-logout:hover,
ul.menu a.menu-logout:hover {
  background: rgba(240,113,120,.12);
  border-color: rgba(240,113,120,.4);
  color: #f5a0a5;
}

/* ----- Main content area ----- */
#content {
  width: 100%;
  margin: 28px auto 0;
}

/* ----- Navigation breadcrumb ----- */
.navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 22px;
  font-size: .86rem;
  color: var(--quiet);
}
.navigation a { color: var(--muted); }
.navigation a:hover { color: var(--white); }
.navigation .active { color: var(--text); font-weight: 600; }

/* ----- Cards & Panels ----- */
.card,
.tborder,
.panel,
fieldset {
  background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 65%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.card.threadlist,
.threadlist.tborder,
.threadlist .thead {
  overflow: visible !important;
}
.tborder { width: 100%; border-collapse: separate; border-spacing: 0; }

/* Table headers */
.thead {
  background: var(--panel-2);
  color: var(--text);
  padding: 16px 20px;
  font-weight: 600;
  font-size: .95rem;
  border-bottom: 1px solid var(--line);
  letter-spacing: -.01em;
}
.thead a { color: var(--text); }
.thead a:hover { color: var(--white); }

.tcat {
  background: rgba(255,255,255,.03);
  color: var(--muted);
  padding: 10px 16px;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}

/* Rows */
.trow1, .trow2 {
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.trow1:last-child, .trow2:last-child { border-bottom: 0; }
tr:hover .trow1,
tr:hover .trow2 {
  background: rgba(255,255,255,.025);
}

.tfoot {
  background: rgba(0,0,0,.2);
  color: var(--muted);
  padding: 12px 16px;
  font-size: .85rem;
  border-top: 1px solid var(--line);
}

/* =========================================================
   DVZ SHOUTBOX – natywny panel (bez przenoszenia DOM)
   ========================================================= */
.index-top-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0 0 28px;
  align-items: stretch;
}
.index-top-row > .forum-card {
  min-height: 280px;
  height: 100%;
}
.forum-card.shoutbox-card {
  padding: 0;
  overflow: hidden;
  min-height: 280px;
}
/* kontener DVZ – zwykły blok, bez flex który zwijał listę */
.shoutbox-card #shoutbox,
.shoutbox-card .dvz_shoutbox,
#shoutbox,
.dvz_shoutbox {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  color: var(--text) !important;
  width: 100% !important;
  display: block !important;
}
.shoutbox-card .thead,
#shoutbox .thead {
  background: var(--panel-2) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 10px 12px !important;
  font-size: .85rem !important;
}
/* OKNO WIADOMOŚCI – zawsze widoczne, wysokość ~4 wpisy */
#shoutbox .window,
#shoutbox_data,
.shoutbox-card .window,
.shoutbox-card #shoutbox_data,
.shoutbox-card .shoutbox_data,
.dvz_shoutbox .window {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 150px !important;
  max-height: 190px !important;
  height: 170px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  font-size: .8rem !important;
  line-height: 1.4 !important;
  color: var(--text) !important;
  background: transparent !important;
}
/* pojedyncze wiadomości */
#shoutbox .window > *,
#shoutbox_data > *,
.shoutbox-card .window > * {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: var(--text) !important;
  padding: 4px 0 !important;
  border-bottom: 1px solid var(--line-soft);
  font-size: .8rem !important;
}
/* małe avatary TYLKO w shoutboxie */
#shoutbox img,
.shoutbox-card img,
.dvz_shoutbox img,
#shoutbox_data img {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  vertical-align: middle !important;
  margin-right: 6px !important;
}

/* ----- Panel użytkownika / profil – avatar ----- */
.usercp-avatar,
.trow1 .usercp-avatar,
td.usercp-avatar-cell {
  width: 100px !important;
  min-width: 100px !important;
  vertical-align: top !important;
  padding: 12px !important;
}
/* avatar TYLKO w dedykowanym wrapperze / klasie avatar */
.usercp-avatar img,
.usercp-avatar-cell img,
.member_profile img.avatar,
.profile-avatar img,
img.avatar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 90px !important;
  height: 90px !important;
  max-width: 90px !important;
  max-height: 90px !important;
  object-fit: cover !important;
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  background: var(--panel-2) !important;
}

/* Ikony PW (koperty) – normalny rozmiar */
#content img[src*="new_pm"],
#content img[src*="old_pm"],
#content img[src*="pm.gif"],
#content img[src*="pm.png"],
#content img[src*="/pm"],
#content .trow1 img[src*="pm"],
#content .trow2 img[src*="pm"],
#content table.tborder td[align="center"] img,
#content table.tborder td.trow1 img:not(.avatar):not([src*="avatar"]):not([src*="uploads/avatars"]),
#content table.tborder td.trow2 img:not(.avatar):not([src*="avatar"]):not([src*="uploads/avatars"]) {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: transparent !important;
  display: inline-block !important;
  vertical-align: middle !important;
}
#shoutbox input[type="text"],
.shoutbox-card input[type="text"],
#shoutbox .textbox {
  min-height: 34px !important;
  font-size: .82rem !important;
  padding: 6px 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Karta: Nowe / nieprzeczytane posty (ten sam rząd co FAQ + shoutbox) */
.forum-card.quickposts-card {
  justify-content: center;
  gap: 14px;
  min-height: 160px;
}
.forum-card.quickposts-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.forum-card.quickposts-card .qp-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.forum-card.quickposts-card .qp-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: .9rem;
  font-weight: 550;
  transition: border-color .18s, background .18s;
}
.forum-card.quickposts-card .qp-links a:hover {
  border-color: #55555c;
  background: rgba(255,255,255,.07);
  color: var(--white);
}
.forum-card.quickposts-card .qp-links a span.qp-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(93,205,122,.15);
}
.forum-card.quickposts-card .qp-links a.qp-daily span.qp-icon {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(122,162,255,.15);
}
.forum-card.quickposts-card .qp-note {
  margin: 0;
  font-size: .78rem;
  color: var(--quiet);
}

/* =========================================================
   FORUM BLOCKS (karty) – główny wymóg
   ========================================================= */
.forum-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 0 0 28px;
}

.forum-card {
  background: linear-gradient(145deg, rgba(255,255,255,.03), transparent 70%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-soft);
  min-height: 160px;
}
.forum-card:hover {
  border-color: #44444c;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}

/* Status – czysta kropka, bez znaku zapytania / emoji */
.forum-card .status-icon {
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 50%;
  background: #55555c;
  margin-top: 6px;
  flex-shrink: 0;
  font-size: 0;
  line-height: 0;
  text-indent: -9999px;
  overflow: hidden;
  border: 0;
}
.forum-card .status-icon.forum_on,
.forum-card .status-icon.on {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(93,205,122,.18);
}
.forum-card .status-icon.forum_off,
.forum-card .status-icon.off {
  background: #44444c;
  opacity: .7;
}
.forum-card .status-icon.forum_offlock,
.forum-card .status-icon.forum_offlink {
  background: #66666d;
  opacity: .55;
}

.forum-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.forum-card h3 a { color: var(--text); }
.forum-card h3 a:hover { color: var(--white); }

.forum-card .desc {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
  flex-grow: 1;
}

.forum-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: .8rem;
  color: var(--quiet);
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.forum-card .meta strong { color: var(--muted); font-weight: 600; }

.forum-card .lastpost {
  font-size: .8rem;
  color: var(--quiet);
  line-height: 1.4;
}
.forum-card .lastpost a { color: var(--muted); }
.forum-card .lastpost a:hover { color: var(--white); }

/* Category header as block */
.cat-block {
  margin: 32px 0 16px;
}
.cat-block:first-child { margin-top: 8px; }
.cat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 4px;
}
.cat-title h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.cat-title h2 a { color: var(--text); }
.cat-title h2 a:hover { color: var(--white); }
.cat-title .expcol {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: background .18s;
}
.cat-title .expcol:hover { background: rgba(255,255,255,.09); color: var(--white); }

/* Subforums list inside card */
.subforums {
  font-size: .82rem;
  color: var(--quiet);
  margin-top: 4px;
}
.subforums a { color: var(--muted); }
.subforums a:hover { color: var(--white); }

/* ----- Buttons ----- */
.button,
input.button,
button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-xs);
  border: 1px solid #e7e7e9;
  background: #e7e7e9;
  color: #111113;
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
  transition: background .18s, transform .15s, border-color .18s;
  text-decoration: none;
}
.button:hover,
input.button:hover,
button:hover,
a.button:hover {
  background: #fff;
  color: #111;
}
.button:active { transform: translateY(1px); }

.button.secondary,
a.button.secondary {
  background: transparent;
  border-color: #38383e;
  color: #dedee1;
}
.button.secondary:hover {
  border-color: #77777e;
  background: rgba(255,255,255,.04);
  color: var(--white);
}

/* Small buttons */
.button.small,
a.button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: .82rem;
}

/* Postbit buttons */
.postbit_buttons > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 2px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  transition: background .18s, color .18s;
}
.postbit_buttons > a:hover {
  background: rgba(255,255,255,.1);
  color: var(--white);
}

/* ----- Forms ----- */
input.textbox,
textarea,
select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"] {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--text);
  background: #0e0e10;
  border: 1px solid #333338;
  border-radius: 9px;
  font: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: #77777e;
  box-shadow: 0 0 0 3px rgba(255,255,255,.055);
}
input::placeholder, textarea::placeholder { color: #65656c; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #0e0e10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23929298' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  color: var(--text);
}
select option {
  background-color: #1a1a1d;
  color: #e9e9eb;
}

label { display: block; margin-bottom: 6px; color: #c6c6ca; font-size: .84rem; }

/* ----- Stats / Board stats ----- */
.boardstats,
#boardstats {
  margin-top: 28px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat-card .label { font-size: .75rem; color: var(--quiet); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .value { font-size: 1.25rem; font-weight: 600; margin-top: 4px; color: var(--text); }

/* Birthdays */
.birthdays {
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--muted);
}

/* ----- Thread list ----- */
.threadlist .trow1,
.threadlist .trow2 {
  padding: 14px 16px;
}
.subject_new { font-weight: 650; color: var(--white); }
.thread_status {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: .9rem;
}

/* ----- Posts ----- */
.post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.post .post_author {
  padding: 16px 18px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}
.post .post_author .author_avatar img {
  border-radius: 12px;
  width: 64px;
  height: 64px;
  object-fit: cover;
}
.post_body {
  padding: 18px 20px;
  font-size: .98rem;
  line-height: 1.6;
  color: #d0d0d4;
}
.post_controls {
  padding: 10px 16px;
  background: rgba(0,0,0,.15);
  border-top: 1px solid var(--line-soft);
}

/* Classic post layout adjustments */
.post.classic .post_author {
  float: left;
  width: 180px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 0;
  min-height: 200px;
}
.post.classic .post_content {
  margin-left: 180px;
  border-left: 1px solid var(--line-soft);
}

/* Quotes & code */
blockquote, .codeblock {
  background: #1c1c1f;
  border: 1px solid var(--line);
  border-left: 4px solid #55555c;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 14px 16px;
  margin: 12px 0;
  color: #c8c8cc;
}
blockquote cite {
  display: block;
  font-weight: 600;
  font-style: normal;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 16px 0;
  font-size: .88rem;
}
.pagination a,
.pagination .pagination_current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  transition: all .18s;
}
.pagination a:hover {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border-color: #555;
}
.pagination .pagination_current {
  background: #e7e7e9;
  color: #111;
  border-color: #e7e7e9;
  font-weight: 650;
}

/* ----- Alerts ----- */
.pm_alert, .red_alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .9rem;
  text-align: center;
}
.pm_alert {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(93,205,122,.12);
  border: 1px solid rgba(93,205,122,.35);
  color: #a8e6b8;
  text-align: left;
  position: relative;
}
/* pulsująca koperta przy powiadomieniu PW */
.pm_alert::before {
  content: "✉";
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(122,162,255,.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: #c5d6ff;
  animation: pm-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(122,162,255,.35);
}
@keyframes pm-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(122,162,255,.4); }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(122,162,255,0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(122,162,255,0); }
}
.pm_alert a { color: #d4f0dc !important; text-decoration: underline; }
.pm_alert a:hover { color: #ffffff !important; }
.red_alert {
  background: rgba(240,113,120,.12);
  border: 1px solid rgba(240,113,120,.35);
  color: #f5a0a5;
}

/* ----- PW: link w menu + wyskakujące powiadomienie ----- */
.menu a.menu-pm {
  position: relative;
}
.menu a.menu-pm .pm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}
.pm-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 0 0 18px auto;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.04), transparent 60%), var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  text-align: left;
  text-decoration: none !important;
  color: var(--text) !important;
  transition: border-color .18s, transform .15s, box-shadow .18s;
}
.pm-toast:hover {
  border-color: #55555c;
  transform: translateY(-1px);
  color: var(--white) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.pm-toast-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(122,162,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  animation: pm-pulse 1.4s ease-in-out infinite;
}
.pm-toast-body { min-width: 0; flex: 1; }
.pm-toast-title {
  font-weight: 700;
  font-size: .95rem;
  margin: 0 0 2px;
  color: var(--text);
}
.pm-toast-text {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.4;
}
.pm-toast-arrow {
  color: var(--quiet);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Sortowanie wątków – 3 pola + OK w jednej linii */
.fd-sort-form {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}
.fd-sort-form select {
  display: inline-block !important;
  width: auto !important;
  min-width: 150px;
  max-width: 280px;
  min-height: 38px !important;
  margin: 0 !important;
  flex: 0 1 auto;
  color: #e9e9eb !important;
  background-color: #0e0e10 !important;
}
.fd-sort-form select option {
  background-color: #1a1a1d !important;
  color: #e9e9eb !important;
}
.fd-sort-form .button,
.fd-sort-form input.button {
  display: inline-flex !important;
  width: auto !important;
  min-height: 38px !important;
  margin: 0 !important;
  flex: 0 0 auto;
}
.tfoot .fd-sort-form {
  float: none;
}
@media (max-width: 700px) {
  .fd-sort-form {
    flex-direction: column;
    align-items: stretch;
  }
  .fd-sort-form select,
  .fd-sort-form .button,
  .fd-sort-form input.button {
    width: 100% !important;
    max-width: none;
  }
  .pm-toast {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ----- Footer ----- */
#footer,
footer {
  width: min(100% - 40px, 1120px);
  margin: 40px auto 0;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #66666d;
  font-size: .78rem;
}
#footer a, footer a { color: #85858c; }
#footer a:hover, footer a:hover { color: #ddd; }

/* ----- Utility ----- */
.float_left { float: left; }
.float_right { float: right; }
.clear { clear: both; }
.hidden { display: none; }
.smalltext { font-size: .82rem; color: var(--muted); }
.largetext { font-size: 1.15rem; font-weight: 600; }

/* Scale images in posts */
.scaleimages img { max-width: 100%; height: auto; }

/* ----- Lista tematów: przycisk Napisz wątek (poza tabelą) ----- */
.newthread-bar {
  margin: 0 0 14px;
  width: 100%;
}
a.btn-newthread {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 48px !important;
  padding: 14px 18px !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  color: #000000 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-decoration: none !important;
  border: 0 !important;
  border-radius: 12px !important;
  white-space: normal !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  font-family: var(--font) !important;
}
a.btn-newthread:hover,
a.btn-newthread:focus {
  background: #f0f0f2 !important;
  color: #000000 !important;
}
.threadlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.threadlist-title {
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}
.threadlist-search { color: var(--muted); font-size: .85rem; }
.threadlist-search:hover { color: var(--white); }

/* Kto jest online – lista osób */
.whosonline {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--muted);
}
.whosonline .wo-head {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .95rem;
}
.whosonline .wo-note {
  margin-bottom: 10px;
  line-height: 1.45;
  color: var(--muted);
}
.whosonline .wo-members {
  display: block;
  margin-top: 4px;
  color: var(--text);
  line-height: 1.6;
  font-size: .9rem;
  min-height: 1.2em;
}
.whosonline .wo-members a,
.whosonline .wo-user a,
.whosonline a {
  color: #7aa2ff !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.whosonline .wo-members a:hover,
.whosonline a:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}
.whosonline .wo-fulllist {
  color: var(--muted) !important;
  font-weight: 500 !important;
  font-size: .82rem;
  margin-left: 4px;
}
.whosonline .wo-fulllist:hover {
  color: var(--white) !important;
}
.whosonline .wo-members {
  margin-top: 8px;
}

/* ----- Szybka odpowiedź / nowy wątek ----- */
#quickreply_e, .quick_reply { margin-top: 20px; }
.qr-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}
.qr-options label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
}
.qr-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  flex-shrink: 0;
}
.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.qr-message textarea,
#message,
#content textarea[name="message"] {
  width: 100% !important;
  min-height: 140px;
  box-sizing: border-box;
}

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .index-top-row {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .index-top-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .forum-blocks {
    grid-template-columns: 1fr;
  }
  .post.classic .post_author {
    float: none;
    width: 100%;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .post.classic .post_content {
    margin-left: 0;
    border-left: 0;
  }
}

@media (max-width: 600px) {
  #container { width: calc(100% - 24px); }
  #header, .topbar, #footer, footer {
    width: calc(100% - 24px);
    min-height: 60px;
  }
  .brand, .logo a { font-size: .68rem; letter-spacing: .14em; }
  .menu a, ul.menu a { padding: 7px 11px; font-size: .82rem; }
  .forum-card { padding: 18px; min-height: 140px; }
  .forum-card h3 { font-size: 1rem; }
  .cat-title h2 { font-size: 1.05rem; }
  #footer, footer {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .welcome { font-size: .82rem; gap: 10px; }

  /* Przycisk Napisz wątek – mobilny */
  .newthread-bar {
    margin: 0 0 12px;
  }
  a.btn-newthread {
    min-height: 50px !important;
    font-size: 17px !important;
    padding: 16px 18px !important;
    color: #000000 !important;
    background: #ffffff !important;
  }
  .threadlist-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Szybka odpowiedź + nowy wątek – duże pole, opcje POD nim */
  #quickreply_e,
  .quick_reply,
  form[action*="newreply"],
  form[action*="newthread"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 24px !important;
  }
  #quickreply_e table,
  #quickreply_e td,
  #quickreply_e tr {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #quickreply_e textarea,
  #message,
  .qr-message textarea,
  form[action*="newthread"] textarea[name="message"],
  form[action*="newreply"] textarea[name="message"],
  #content textarea[name="message"] {
    width: 100% !important;
    min-height: 50vh !important;
    max-height: 70vh !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }
  .qr-options,
  #quickreply_e label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    margin: 8px 0 !important;
  }
  .qr-actions {
    width: 100%;
  }
  .qr-actions .button,
  #quickreply_e input.button {
    flex: 1;
    min-width: 0;
  }
  /* formularz nowego wątku – układ pionowy */
  form[action*="newthread"] .trow1,
  form[action*="newthread"] .trow2,
  form[action*="newreply"] .trow1,
  form[action*="newreply"] .trow2 {
    display: block !important;
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ----- Misc MyBB elements ----- */
.popup_menu {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
}
.popup_menu .popup_item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
}
.popup_menu .popup_item:hover {
  background: rgba(255,255,255,.08);
  color: var(--white);
}

.jGrowl .jGrowl-notification {
  background: var(--panel) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* Editor */
.editor, .editor_control_bar {
  background: #121214;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* Reputation colors */
.reputation_positive { color: var(--green); }
.reputation_negative { color: var(--red); }
.reputation_neutral { color: var(--muted); }

/* High warning etc */
.high_warning { color: var(--red); }
.online { color: var(--green); }
.offline { color: var(--quiet); }

/* Select all bar */
.selectall {
  background: rgba(122,162,255,.12);
  border: 1px solid rgba(122,162,255,.3);
  color: #b8cdff;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-xs);
}

/* Thread legend + tools moderatorskie */
.thread_legend {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.thread_legend dd {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.thread_status {
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 4px;
  background: #3a3a42;
  vertical-align: middle;
}
.thread_status.newfolder,
.thread_status.hotnewfolder,
.thread_status.newdot_folder { background: var(--green); box-shadow: 0 0 0 2px rgba(93,205,122,.2); }
.thread_status.folder,
.thread_status.hotfolder,
.thread_status.dot_folder { background: #55555c; }
.thread_status.closefolder { background: var(--red); opacity: .85; }

.fd-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.fd-tools-left,
.fd-tools-right {
  flex: 1 1 280px;
  min-width: 0;
}
.fd-tool-label {
  display: block;
  margin-bottom: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.fd-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fd-select,
.fd-search-input,
.fd-inlinemod select,
.fd-search input.textbox {
  min-height: 38px !important;
  width: auto !important;
  max-width: 100%;
  flex: 1 1 160px;
  background: #0e0e10 !important;
  border: 1px solid #333338 !important;
  color: var(--text) !important;
  border-radius: 9px !important;
  padding: 8px 12px !important;
}
.fd-inlinemod .button,
.fd-search .button {
  flex: 0 0 auto;
}
@media (max-width: 700px) {
  .fd-tools { flex-direction: column; }
  .thread_legend { grid-template-columns: 1fr; }
  .fd-tool-row { flex-direction: column; align-items: stretch; }
  .fd-tool-row .button { width: 100%; }
}

/* ----- Cookie notification (Simple Cookie Notification) ----- */
#simplecookienotification_v01 {
  display: block;
  z-index: 99999 !important;
  min-height: 48px;
  width: 100%;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: var(--panel-2) !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 12px 12px 0 0 !important;
  color: var(--muted) !important;
  text-align: center;
  box-shadow: 0 -8px 30px rgba(0,0,0,.35);
  padding: 12px 70px 12px 16px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.45;
}
#simplecookienotification_v01.scn-hidden,
#simplecookienotification_v01[data-accepted="1"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
#simplecookienotification_v01 a {
  color: var(--text) !important;
  text-decoration: underline;
}
#simplecookienotification_v01 a:hover {
  color: var(--white) !important;
}
#simplecookienotification_v01 #okbutton,
#okbutton {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%);
  background: #c62828 !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border: 0 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  white-space: nowrap;
}
#simplecookienotification_v01 #okbutton:hover,
#okbutton:hover {
  background: #e53935 !important;
  color: #ffffff !important;
}
@media (max-width: 600px) {
  #simplecookienotification_v01 {
    padding: 14px 14px 56px;
    border-radius: 12px 12px 0 0 !important;
  }
  #simplecookienotification_v01 #okbutton,
  #okbutton {
    top: auto !important;
    bottom: 10px !important;
    right: 50% !important;
    transform: translateX(50%);
    width: calc(100% - 28px);
    max-width: 280px;
    text-align: center;
  }
}
