/* Forum CSE — charte Clever Cloud */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin-700.woff2") format("woff2");
}

:root {
  --cc-cherry: #a51050;
  --cc-red: #cb1c42;
  --cc-orange: #f57461;
  --cc-purple: #3a3871;
  --cc-purple-hover: #5754aa;
  --cc-green: #11bea9;
  --cc-gradient: linear-gradient(90deg, #a51050 0%, #cb1c42 50.48%, #f57461 100%);

  --bg: #f9f9fb;
  --surface: #ffffff;
  --surface-tint: #f1f0fb;
  --border: #deddee;
  --text: #13172e;
  --text-muted: #73738e;
  --link: #a51050;
  --focus: #5754aa;
  --warning-bg: #fff4e5;
  --warning-text: #8a4b00;
  --error-bg: #fdecef;
  --error-text: #a3122f;
  --success-bg: #e6f8f5;
  --success-text: #0b6e62;
  --mark: #ffe3dd;
  --code-bg: #f1f0fb;

  --radius: 10px;
  --radius-small: 6px;
  --shadow: 0 1px 2px rgba(19, 23, 46, 0.06), 0 4px 16px rgba(19, 23, 46, 0.04);
  --font: "Plus Jakarta Sans", arial, helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #13172e;
    --surface: #1c2045;
    --surface-tint: #262a57;
    --border: #33386a;
    --text: #f1f0fb;
    --text-muted: #a9a8c6;
    --link: #f57461;
    --focus: #8f8cf0;
    --warning-bg: #3d2f12;
    --warning-text: #ffcf8a;
    --error-bg: #461b2b;
    --error-text: #ff9fb3;
    --success-bg: #103b3a;
    --success-text: #7fe6d7;
    --mark: #6b2a3a;
    --code-bg: #262a57;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

code, pre { font-family: var(--mono); font-size: 0.9em; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

.test-banner {
  background: repeating-linear-gradient(135deg, #f5a623 0 14px, #f7b547 14px 28px);
  color: #13172e;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 16px;
}

/* En-tête ------------------------------------------------------------------------------- */

.site-header {
  background: var(--cc-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(165, 16, 80, 0.25);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; }
.brand img {
  background: #fff;
  border-radius: 8px;
  padding: 3px 4px;
  width: 34px;
  height: 38px;
}
.header-search { flex: 1; min-width: 180px; }
.header-search input[type="search"] {
  width: 100%;
  max-width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
}
.header-search input[type="search"]::placeholder { color: rgba(255, 255, 255, 0.8); }
.header-search input[type="search"]:focus { background: rgba(255, 255, 255, 0.25); outline: none; border-color: #fff; }
.header-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.header-nav form { margin: 0; }
.nav-link { color: #fff; font-weight: 600; }
.nav-link:hover { text-decoration: underline; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Boutons ------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--cc-cherry); color: #fff; }
.btn-primary:hover { background: var(--cc-red); }
.btn-secondary { background: var(--cc-purple); color: #fff; }
.btn-secondary:hover { background: var(--cc-purple-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-tint); }
.btn-on-brand { background: #fff; color: var(--cc-cherry); }
.btn-on-brand:hover { background: #fff4f1; }
.btn-small { padding: 5px 12px; font-size: 0.85rem; }
.btn-large { padding: 12px 26px; font-size: 1.05rem; }

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.action-link { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.action-link:hover { color: var(--link); text-decoration: none; }
.danger:hover { color: var(--error-text); }

/* Cartes, messages ---------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.flash {
  border-radius: var(--radius-small);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-weight: 600;
  border-left: 4px solid currentColor;
}
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }
.flash-warning { background: var(--warning-bg); color: var(--warning-text); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-open { background: var(--success-bg); color: var(--success-text); }
.badge-closed { background: var(--surface-tint); color: var(--text-muted); }
.badge-pinned { background: #fdebe7; color: var(--cc-cherry); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-neutral { background: var(--surface-tint); color: var(--cc-purple); }
.badge-elu { background: rgba(255, 255, 255, 0.95); color: var(--cc-cherry); }
.badge-role { font-size: 0.7rem; letter-spacing: 0.01em; }
.badge-role::before { content: "★"; font-size: 0.65rem; }
.badge-role-titulaire { background: var(--cc-cherry); color: #fff; }
.badge-role-suppleant { background: transparent; color: var(--cc-cherry); box-shadow: inset 0 0 0 1px var(--cc-cherry); }
.badge-role-suppleant::before { content: "☆"; }
@media (prefers-color-scheme: dark) {
  .badge-role-suppleant { color: #ffb3a6; box-shadow: inset 0 0 0 1px #ffb3a6; }
  .badge-pinned { background: #4a1d2f; color: #ffb3a6; }
  .badge-neutral { color: #cfcdf7; }
}

.label {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  background: var(--cc-purple);
  color: #fff;
  white-space: nowrap;
}
a.label:hover { text-decoration: none; filter: brightness(1.08); }
.label.is-selected { outline: 2px solid var(--text); outline-offset: 1px; }

/* Pages --------------------------------------------------------------------------------- */

.page-head { margin-bottom: 20px; }
.page-head p { margin: 0; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 600; font-size: 0.9rem; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tabs { display: flex; gap: 4px; background: var(--surface-tint); padding: 4px; border-radius: 999px; }
.tab { padding: 5px 14px; border-radius: 999px; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--cc-cherry); box-shadow: var(--shadow); }
.sort { display: flex; gap: 10px; align-items: center; font-size: 0.9rem; }
.sort-link { color: var(--text-muted); font-weight: 600; }
.sort-link.is-active { color: var(--cc-cherry); }
.label-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.clear-filter { font-size: 0.85rem; font-weight: 600; }

.empty-state { text-align: center; padding: 40px 24px; }

/* Liste des sujets ---------------------------------------------------------------------- */

.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.topic-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.topic-card.is-pinned { border-left: 4px solid var(--cc-cherry); }
.topic-card.is-hidden { opacity: 0.7; border-style: dashed; }
.topic-card-main { flex: 1; min-width: 0; }
.topic-card-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topic-card-title a { color: var(--text); font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.topic-card-title a:hover { color: var(--cc-cherry); text-decoration: none; }
.topic-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.85rem; margin-top: 4px; }
.topic-card-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 0.85rem; white-space: nowrap; }
.stat { color: var(--text); font-weight: 600; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 20px; }

/* Vote ---------------------------------------------------------------------------------- */

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  margin: 0;
}
.vote-btn {
  width: 36px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 0.85rem;
}
.vote-btn:hover:not(:disabled) { border-color: var(--cc-cherry); color: var(--cc-cherry); }
.vote-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.vote.is-voted .vote-btn { background: var(--cc-cherry); border-color: var(--cc-cherry); color: #fff; }
.vote-score { font-weight: 700; font-size: 0.95rem; }

/* Auteur -------------------------------------------------------------------------------- */

.author { font-weight: 600; }
.author.is-anonymous { font-style: italic; color: var(--text-muted); }
.anon-icon { font-style: normal; }
.revealed { font-style: normal; color: var(--cc-purple); background: var(--surface-tint); border-radius: 4px; padding: 0 4px; }
@media (prefers-color-scheme: dark) { .revealed { color: #cfcdf7; } }

/* Sujet --------------------------------------------------------------------------------- */

.topic { padding: 24px; }
.topic-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.topic-heading { flex: 1; min-width: 0; }
.topic-heading h1 { margin: 6px 0; overflow-wrap: anywhere; }
.topic-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.topic-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 0.9rem; }
.topic-body { font-size: 1rem; }
.topic-footer, .comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.actions { display: flex; gap: 14px; align-items: center; }
.actions form { margin: 0; }

.closed-banner {
  background: var(--surface-tint);
  border-radius: var(--radius-small);
  padding: 12px 16px;
  margin-bottom: 16px;
  border-left: 4px solid var(--cc-purple);
}
.closed-banner p { margin: 4px 0 0; }
.closed-note { text-align: center; padding: 16px; }

.admin-panel { border-color: var(--cc-purple); }
.admin-panel summary { cursor: pointer; }
.admin-panel-body { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
.admin-close { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.admin-close .field { flex: 1; min-width: 220px; margin: 0; }
.admin-labels { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Commentaires -------------------------------------------------------------------------- */

.comments { margin-top: 28px; }
.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  scroll-margin-top: 16px;
}
.comment:target { border-color: var(--cc-cherry); box-shadow: 0 0 0 3px rgba(165, 16, 80, 0.15); }
.comment.is-hidden { opacity: 0.7; border-style: dashed; }
.depth-1 { margin-left: 28px; }
.depth-2 { margin-left: 56px; }
.depth-3 { margin-left: 84px; }
.depth-4 { margin-left: 112px; }
.depth-5 { margin-left: 140px; }
.depth-6 { margin-left: 168px; }
.comment[class*="depth-"]:not(.depth-0) { border-left: 3px solid var(--border); }
.comment-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.85rem; }
.comment-body { margin-top: 4px; }
.placeholder { color: var(--text-muted); font-style: italic; margin: 6px 0; }
.reply > summary { list-style: none; display: inline-block; margin-top: 6px; }
.reply > summary::-webkit-details-marker { display: none; }
.reply[open] > summary { color: var(--cc-cherry); }
.comment-form { margin-top: 10px; }
.new-comment { margin-top: 20px; }

/* Réactions ----------------------------------------------------------------------------- */

.reactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: relative; }
.reactions form { margin: 0; }
.reaction, .reaction-quick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 2px 9px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.reaction:hover:not(:disabled), .reaction-quick:hover { border-color: var(--cc-cherry); }
.reaction.is-mine, .reaction-quick.is-mine { background: #fdebe7; border-color: var(--cc-cherry); }
@media (prefers-color-scheme: dark) {
  .reaction.is-mine, .reaction-quick.is-mine { background: #4a1d2f; }
}
.reaction:disabled { cursor: default; }
.reaction-count { font-weight: 700; font-size: 0.8rem; }
.reaction-picker { position: relative; }
.reaction-picker > summary {
  list-style: none;
  cursor: pointer;
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.reaction-picker > summary::-webkit-details-marker { display: none; }
.reaction-picker > summary:hover { color: var(--cc-cherry); border-color: var(--cc-cherry); }
.picker-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(19, 23, 46, 0.15);
  padding: 10px;
  width: 260px;
}
.picker-quick { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.picker-quick .reaction-quick { font-size: 1.1rem; padding: 2px 7px; }
.picker-custom { display: flex; gap: 6px; }
.picker-custom input { flex: 1; min-width: 0; }
.reaction-error { color: var(--error-text); font-size: 0.8rem; font-weight: 600; }

/* Formulaires --------------------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; }
.field-label { font-weight: 700; font-size: 0.9rem; }

input[type="text"], input[type="search"], textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-small);
  padding: 8px 12px;
  font: inherit;
}
input[type="text"]:focus, input[type="search"]:focus, textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(87, 84, 170, 0.2);
}
input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 0 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  cursor: pointer;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checkbox input { margin-top: 4px; accent-color: var(--cc-cherry); }
.checkbox small { display: block; }
.checkbox-inline { align-items: center; font-size: 0.9rem; }
.checkbox-inline input { margin-top: 0; }
.checkbox-inline:has(small) { align-items: flex-start; max-width: 60ch; }
.checkbox-inline:has(small) input { margin-top: 3px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.comment-form .form-actions { justify-content: space-between; }

.label-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.label-choice { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.label-choice input { accent-color: var(--cc-cherry); }

.editor { position: relative; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.hint { font-size: 0.8rem; color: var(--text-muted); }
.preview:not(:empty) {
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-small);
  background: var(--bg);
}

.emoji-suggest {
  position: absolute;
  z-index: 30;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  box-shadow: 0 8px 24px rgba(19, 23, 46, 0.15);
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
}
.emoji-suggest li { padding: 4px 8px; border-radius: 4px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.emoji-suggest li.is-active, .emoji-suggest li:hover { background: var(--surface-tint); }
.emoji-suggest .emoji-char { font-size: 1.2rem; }

/* Rendu Markdown ------------------------------------------------------------------------ */

.markdown { overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote, .markdown pre, .markdown table { margin: 0 0 0.75em; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { font-size: 1.05rem; margin: 1em 0 0.5em; }
.markdown blockquote {
  border-left: 4px solid var(--cc-orange);
  background: var(--surface-tint);
  margin-left: 0;
  padding: 6px 14px;
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}
.markdown code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.markdown pre { background: var(--code-bg); padding: 10px 14px; border-radius: var(--radius-small); overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown img { max-width: 100%; height: auto; }
.markdown table { border-collapse: collapse; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 4px 10px; }
.markdown ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 0.5em; }
.markdown input[type="checkbox"] { accent-color: var(--cc-cherry); }

/* Recherche ----------------------------------------------------------------------------- */

.search-form { display: flex; gap: 8px; margin-top: 12px; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-hit { padding: 14px 18px; }
.search-hit-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.search-hit-head a { font-weight: 700; color: var(--text); }
.search-excerpt { margin: 6px 0 0; color: var(--text-muted); white-space: pre-line; }
mark { background: var(--mark); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* Administration ------------------------------------------------------------------------ */

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.admin-grid .card { margin-bottom: 0; }
.admin-grid + .card { margin-top: 16px; }
.user-list, .label-admin-list { list-style: none; padding: 0; margin: 0 0 16px; }
.user-list li, .label-admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.user-list li:last-child, .label-admin-list li:last-child { border-bottom: 0; }
.user-list form, .label-admin-list form { margin: 0; }
.user-filter { margin-bottom: 8px; }
.user-list li > div:first-child { min-width: 0; }
.role-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.label-admin-list .label-form { flex-wrap: nowrap; min-width: 0; }
.label-admin-list .label-form input[type="text"] { min-width: 0; }
.label-admin-list .label-form .label { flex-shrink: 0; }
.label-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.label-form input[type="text"] { flex: 1; min-width: 120px; width: auto; }
.label-admin-list .label-form { flex: 1; margin: 0; }
.log-table, .help-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.log-table th, .log-table td, .help-table th, .help-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Aide, connexion, erreurs -------------------------------------------------------------- */

.help-source { margin: 0; white-space: pre-wrap; background: var(--code-bg); padding: 8px 10px; border-radius: var(--radius-small); }
.emoji-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.emoji-big { font-size: 1.3rem; }

.login, .error-page {
  max-width: 480px;
  margin: 48px auto;
  text-align: center;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-form input[type="password"] {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-small);
  padding: 8px 12px;
  font: inherit;
}
.login-form .btn { align-self: stretch; }
.login h1, .error-page h1 { margin: 8px 0 0; }
.login p, .error-page p { margin: 0 0 12px; }
.error-code {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0;
  background: var(--cc-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Mobile -------------------------------------------------------------------------------- */

@media (max-width: 720px) {
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
  .topic { padding: 16px; }
  .header-search { order: 3; flex-basis: 100%; }
  .header-search input[type="search"] { max-width: none; }
  .header-nav { gap: 10px; font-size: 0.9rem; }
  .user-chip { display: none; }
  .topic-card { gap: 10px; padding: 12px; align-items: flex-start; }
  .topic-card-stats { display: none; }
  .depth-1 { margin-left: 12px; }
  .depth-2 { margin-left: 24px; }
  .depth-3 { margin-left: 36px; }
  .depth-4 { margin-left: 48px; }
  .depth-5 { margin-left: 60px; }
  .depth-6 { margin-left: 72px; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .search-form { flex-direction: column; }
}
