/* Thème « prosilver rénové » : sobre, lisible, responsive. */
:root {
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --line: #ccd3da;
  --line-soft: #e3e8ed;
  --text: #2b3238;
  --muted: #6b7681;
  --accent: #2f5d7c;
  --accent-2: #24485f;
  --header-bg: #1d3a4d;
  --header-text: #eaf2f8;
  --link: #1f5f8b;
  --btn: #2f5d7c;
  --radius: 4px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.theme-rouge {
  --accent: #8e3b46;
  --accent-2: #6f2a34;
  --header-bg: #4a1f26;
  --header-text: #f7ecee;
  --link: #8e3b46;
  --btn: #8e3b46;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; font-weight: 600; }
p { margin: .5rem 0; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 9; }

.wrap { width: min(1140px, 100% - 2rem); margin-inline: auto; }

/* ---------- en-tête ---------- */
.site-head { background: var(--header-bg); color: var(--header-text); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0 .7rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px 10px 10px 3px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: inset 0 0 0 1px #ffffff33;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem; color: var(--header-text);
  flex: none;
}
.brand-text strong { display: block; font-size: 1.15rem; letter-spacing: .01em; }
.brand-text small { display: block; font-size: .76rem; opacity: .75; max-width: 52ch; }
.site-nav { display: flex; align-items: center; gap: .4rem; font-size: .88rem; flex-wrap: wrap; }
.site-nav a { color: var(--header-text); opacity: .9; padding: .25rem .45rem; border-radius: 3px; }
.site-nav a:hover { background: #ffffff1a; opacity: 1; text-decoration: none; }
.nav-user { display: inline-flex; align-items: center; gap: .4rem; }
.btn-mini { border: 1px solid #ffffff55; }
.subnav { display: flex; gap: .2rem; padding-bottom: .55rem; font-size: .84rem; flex-wrap: wrap; }
.subnav a { color: var(--header-text); opacity: .72; padding: .15rem .4rem; }
.subnav a:hover { opacity: 1; }

/* ---------- fil d'ariane ---------- */
.crumb-bar { padding: .7rem 0 .2rem; font-size: .85rem; color: var(--muted); }
.crumb-bar .sep { margin: 0 .3rem; opacity: .6; }

main { padding: 1rem 0 3rem; }

/* ---------- index ---------- */
.board-head { margin-bottom: 1.2rem; }
.board-head p { color: var(--muted); margin: 0; max-width: 70ch; }
.board-stats { margin-top: .5rem; font-size: .82rem; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }

.cat { margin-bottom: 1.6rem; }
.cat-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: #fff; background: var(--accent); margin: 0;
  padding: .45rem .8rem; border-radius: var(--radius) var(--radius) 0 0;
}
.forums-table { background: var(--panel); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.forums-head, .forum-row {
  display: grid; grid-template-columns: 1fr 70px 80px 150px; gap: .5rem; align-items: center;
}
.forums-head {
  background: var(--panel-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: .5rem .8rem; border-bottom: 1px solid var(--line-soft);
}
.forum-row { padding: .7rem .8rem; border-bottom: 1px solid var(--line-soft); }
.forum-row:last-child { border-bottom: 0; }
.forum-row:hover { background: #f9fbfc; }
.forum-link { display: flex; gap: .6rem; align-items: flex-start; color: inherit; }
.forum-link:hover { text-decoration: none; }
.forum-link strong { color: var(--link); font-weight: 600; }
.forum-link:hover strong { text-decoration: underline; }
.forum-link em { display: block; font-style: normal; font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.forum-icon { font-size: 1.1rem; line-height: 1.4; }
.forum-num { text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); }
.forum-last { font-size: .8rem; }
.forum-last .lastpost { color: var(--link); }

/* ---------- listes de sujets ---------- */
.page-head { margin-bottom: 1rem; position: relative; }
.page-desc { color: var(--muted); margin: 0; max-width: 70ch; }
.page-head .btn { position: absolute; right: 0; top: .2rem; }
.topic-head .btn { top: .4rem; }
.topic-info, .locked { font-size: .85rem; color: var(--muted); margin: .2rem 0 0; }

.topics-table, .table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.topics-head, .topic-row {
  display: grid; grid-template-columns: 1fr 56px 56px 150px; gap: .5rem; align-items: center;
}
.topics-head, .table-head {
  background: var(--panel-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: .5rem .8rem; border-bottom: 1px solid var(--line-soft);
}
.topic-row { padding: .6rem .8rem; border-bottom: 1px solid var(--line-soft); }
.topic-row:last-child { border-bottom: 0; }
.topic-row.pinned { background: #fffdf3; }
.topic-icon { display: none; }
.topic-title { font-weight: 600; }
.topic-sub { font-size: .78rem; color: var(--muted); }
.topic-num { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; }
.topic-last { font-size: .78rem; }
.mini-pages a { font-size: .72rem; padding: 0 .15rem; color: var(--muted); }

/* ---------- messages ---------- */
.posts { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.post {
  display: grid; grid-template-columns: 170px 1fr;
  border-bottom: 1px solid var(--line);
}
.post:last-child { border-bottom: 0; }
.post-profile {
  background: var(--panel-2); padding: 1rem .8rem; text-align: center;
  border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: .35rem; align-items: center;
  font-size: .78rem;
}
.post-author { font-weight: 700; font-size: .92rem; color: var(--link); word-break: break-word; }
.post-rank { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.post-meta { color: var(--muted); font-size: .74rem; }
.post-body { padding: 1rem 1.1rem 1.2rem; min-width: 0; }
.post-head {
  display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap;
  font-size: .74rem; color: var(--muted); border-bottom: 1px solid var(--line-soft);
  padding-bottom: .45rem; margin-bottom: .8rem;
}
.post-anchor { color: #aab3bc; }
.post-edited { font-style: italic; }
.post-content { overflow-wrap: anywhere; }
.post-content img, .post-signature img { max-width: 100%; height: auto; border-radius: 3px; }
.post-content a { text-decoration: underline; }
.post-signature:empty { display: none; }
.post-signature {
  margin-top: 1rem; padding-top: .6rem; border-top: 1px dashed var(--line);
  font-size: .8rem; color: var(--muted); max-height: 8em; overflow: hidden;
}
.post-actions { margin-top: .6rem; display: flex; gap: .8rem; font-size: .78rem; }
.post-actions a { color: var(--muted); }

blockquote { margin: .6rem 0; padding: .5rem .8rem; border-left: 3px solid var(--accent); background: #f4f7f9; color: #4a545c; font-size: .92em; }
.bbquote cite, blockquote cite { display: block; font-size: .78rem; color: var(--muted); font-style: normal; margin-bottom: .25rem; }
.bbquote, blockquote.bbquote {
  margin: .6rem 0; padding: .5rem .8rem; border-left: 3px solid var(--accent);
  background: #f4f7f9; color: #4a545c; font-size: .92em;
}
.bbquote cite { display: block; font-size: .78rem; color: var(--muted); font-style: normal; margin-bottom: .25rem; }
.bbcode-code, pre.codebox {
  background: #f4f6f8; border: 1px solid var(--line); border-radius: 3px;
  padding: .6rem .8rem; overflow-x: auto; font: .85rem/1.45 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--av-size, 64px); height: var(--av-size, 64px); border-radius: 50%;
  background: var(--av-bg, #777); color: #fff; font-weight: 700;
  font-size: calc(var(--av-size, 64px) / 2.8); letter-spacing: .02em;
  flex: none; user-select: none;
}

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: flex-end; margin: .6rem 0; }
.pagination .pages { font-size: .85rem; display: flex; gap: .15rem; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination strong {
  padding: .15rem .45rem; border-radius: 3px; border: 1px solid transparent;
}
.pagination a { color: var(--link); }
.pagination a:hover { background: var(--panel); border-color: var(--line); text-decoration: none; }
.pagination strong.current { background: var(--accent); color: #fff; }
.ellipsis { color: var(--muted); padding: 0 .2rem; }

/* ---------- formulaires ---------- */
.btn {
  display: inline-block; background: var(--btn); color: #fff; border: 0;
  padding: .5rem .95rem; border-radius: 3px; font-size: .88rem; font-weight: 600;
  cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent-2); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }

.field { display: block; margin-bottom: .9rem; }
.field span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 3px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid #9fc0d6; outline-offset: 1px; border-color: #7fa6bf; }
textarea { resize: vertical; min-height: 8rem; }
.post-form, .stack { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.form-actions { display: flex; gap: .6rem; align-items: center; }
.narrow { max-width: 460px; margin: 0 auto; }
.inline-search { display: flex; gap: .5rem; margin-bottom: .9rem; }
.inline-search input { flex: 1; }

.notice { background: #eaf4ff; border: 1px solid #b8d8f2; padding: .6rem .8rem; border-radius: 3px; margin-bottom: 1rem; font-size: .9rem; }
.error { background: #fdecec; border: 1px solid #f2b8b8; color: #8b2222; padding: .6rem .8rem; border-radius: 3px; margin-bottom: 1rem; font-size: .9rem; }

/* ---------- divers ---------- */
.quick-reply { margin-top: 1.6rem; }
.quick-reply form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.quick-reply .btn { margin-top: .6rem; }
.table-head, .table-row { display: grid; grid-template-columns: 1fr 90px 140px 140px; gap: .5rem; }
.table-row { padding: .55rem .8rem; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.table-row:last-child { border-bottom: 0; }
.simple-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.simple-row { padding: .6rem .8rem; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: .15rem; }
.simple-row:last-child { border-bottom: 0; }
.simple-row small { color: var(--muted); }
.profile-head { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1rem; }
.signature-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; }
.signature-box h2 { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.empty-state { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem 1.2rem; text-align: center; }
.empty-state h2 { margin-top: 0; }
.empty-state .codebox { display: inline-block; text-align: left; margin: .6rem 0; }

/* ---------- pied ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--panel-2); padding: 1.2rem 0 2rem; font-size: .8rem; color: var(--muted); }
.site-foot p { margin: .3rem 0; max-width: 90ch; }

/* ---------- mobile ---------- */
/* évite qu'un tableau de sujets déborde de l'écran (colonnes fixes) */
.topic-main, .forum-name, .topic-title { min-width: 0; }
.topics-table, .forums-table { max-width: 100%; }

@media (max-width: 820px) {
  .forums-head, .forum-row { grid-template-columns: 1fr 56px 56px; }
  .forums-head span:nth-child(4), .forum-last { display: none; }
  .topics-head, .topic-row { grid-template-columns: 1fr 48px; }
  .topics-head span:nth-child(2), .topics-head span:nth-child(3), .topics-head span:nth-child(4),
  .topic-num, .topic-last { display: none; }
  html, body { overflow-x: hidden; }
  .topic-row, .topics-head { grid-template-columns: minmax(0, 1fr) !important; }
  .topic-title { overflow-wrap: anywhere; }
  .post { grid-template-columns: 1fr; }
  .post-profile { flex-direction: row; text-align: left; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: .6rem .8rem; gap: .6rem; }
  .post-profile .avatar { --av-size: 34px; }
  .post-profile .post-meta { display: none; }
  .table-head, .table-row { grid-template-columns: 1fr 70px; }
  .table-head span:nth-child(3), .table-head span:nth-child(4),
  .table-row span:nth-child(3), .table-row span:nth-child(4) { display: none; }
  .head-inner { flex-direction: column; align-items: flex-start; }
  .page-head .btn { position: static; margin-top: .6rem; }
}
