:root {
  --bg: #f6f4ef; --surface: #fff; --text: #1d2327; --muted: #6a7178; --line: #e1ddd3;
  --accent: #0b5d8a; --accent-2: #e8f1f6; --warn: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181b; --surface: #1c2226; --text: #e7eaec; --muted: #9aa3aa; --line: #2c353b; --accent: #6bb6e3; --accent-2: #1f2d36; --warn: #e0b460; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", "Arial Hebrew", Arial, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: baseline; gap: 14px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font-size: 1.6rem; font-weight: 700; text-decoration: none; color: var(--text); }
.tag { color: var(--muted); }
main.wrap { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer.site .wrap { padding-top: 16px; padding-bottom: 24px; }
h1 { font-size: 1.6rem; line-height: 1.3; margin: .2em 0 .3em; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; margin: 0; padding: 10px 14px; background: var(--accent-2); border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); } .s { font-size: .82rem; }
.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 4px; }

.cat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin: 18px 0; overflow: hidden; }
ul.forums { list-style: none; margin: 0; padding: 0; }
ul.forums li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; border-top: 1px solid var(--line); }
ul.forums li:first-child { border-top: 0; }
.ftitle { font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.ftitle:hover { text-decoration: underline; }
.fdesc { color: var(--muted); font-size: .9rem; }
.fstat { display: flex; flex-direction: column; align-items: flex-end; font-size: .85rem; white-space: nowrap; color: var(--muted); }

table.topics { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.topics th { text-align: right; font-size: .85rem; color: var(--muted); background: var(--accent-2); padding: 8px 10px; }
table.topics td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
table.topics .n { text-align: center; white-space: nowrap; }
table.topics .subj a { font-weight: 600; overflow-wrap: anywhere; }
.lock { color: var(--warn); }

.post { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; }
.post.first { border-color: var(--accent); }
.post > header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--accent-2); border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.post .body { padding: 12px 14px; overflow-wrap: anywhere; }
.post .body p { margin: .4em 0; }
.post .body img { max-width: 100%; height: auto; }
.post .body img[src*="/images/smilies/"] { vertical-align: middle; max-height: 1.6em; }
.post .body table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.post .body td, .post .body th { border: 1px solid var(--line); padding: 3px 6px; }
.post .body pre { white-space: pre-wrap; direction: ltr; text-align: left; background: var(--accent-2); padding: 8px; border-radius: 4px; }
.post .body blockquote { margin: .6em 0; padding: .2em 12px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.img-missing { color: var(--muted); font-size: .85em; font-style: italic; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; align-items: center; }
.pager .pg { padding: 4px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }

@media (max-width: 640px) {
  ul.forums li { flex-direction: column; gap: 6px; }
  .fstat { flex-direction: row; gap: 12px; align-items: flex-start; flex-wrap: wrap; white-space: normal; }
  table.topics thead { display: none; }
  table.topics, table.topics tbody, table.topics tr, table.topics td { display: block; width: 100%; }
  table.topics tr { padding: 8px 10px; border-top: 1px solid var(--line); }
  table.topics td { border: 0; padding: 2px 0; text-align: right !important; }
  table.topics .n { display: inline-block; width: auto; margin-inline-end: 12px; }
  table.topics .n::before { content: attr(data-l); }
}

/* ---- חדשות ---- */
header.site .wrap { align-items: center; }
nav.main { margin-inline-start: auto; display: flex; gap: 16px; }
nav.main a { text-decoration: none; font-weight: 600; padding: 4px 2px; border-bottom: 2px solid transparent; }
nav.main a:hover { border-bottom-color: var(--accent); }
h2.sect { background: none; border: 0; padding: 0; margin: 28px 0 8px; font-size: 1.25rem; }
.ncats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 14px 0; }
.ncat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ncat h2 a { text-decoration: none; color: inherit; }
.ncat ul { list-style: none; margin: 0; padding: 8px 14px 12px; columns: 2; column-gap: 14px; }
.ncat li { break-inside: avoid; padding: 2px 0; }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.subcats a { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .92rem; }
.nlist { list-style: none; margin: 0; padding: 0; }
.nitem { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.nitem:first-child { border-top: 0; }
.nthumb img { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; display: block; }
.nbody { min-width: 0; }
.ntitle { font-weight: 700; font-size: 1.1rem; text-decoration: none; overflow-wrap: anywhere; }
.ntitle:hover { text-decoration: underline; }
.nsum { margin: 4px 0 0; color: var(--text); opacity: .85; }
article.news { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; }
article.news h1 { font-size: 1.8rem; }
article.news .meta { margin: 0 0 14px; }
.nbodytext { font-size: 1.05rem; line-height: 1.8; overflow-wrap: anywhere; }
.nbodytext p { margin: .6em 0; }
.nbodytext img { max-width: 100%; height: auto; }
.nbodytext::after { content: ""; display: table; clear: both; }
.nfig { display: block; margin: .3em 0 .6em; max-width: 100%; }
.nfig img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.nfig-right { float: right; margin-inline-start: 0; margin-left: 16px; max-width: 48%; }
.nfig-left { float: left; margin-right: 16px; max-width: 48%; }
.nfig-center { margin-inline: auto; text-align: center; }
.nfig-center img { margin-inline: auto; }
.ncap { display: block; font-size: .82rem; color: var(--muted); margin-top: 3px; }
.extlink { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .nitem { flex-direction: column; gap: 6px; }
  .nthumb img { width: 100%; height: 160px; }
  .nfig-right, .nfig-left { float: none; max-width: 100%; margin: .4em 0; }
  article.news { padding: 14px; }
  .ncat ul { columns: 1; }
}

.ncat h2:last-child { border-bottom: 0; }

.more { font-size: .85rem; font-weight: 400; margin-inline-start: 10px; }
.subcats a.cur { background: var(--red, #c8202a); border-color: var(--red, #c8202a); color: #fff; font-weight: 600; }
