:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --text: #1d2a24;
  --muted: #65736c;
  --primary: #2e6b4f;
  --primary-dark: #1f4e39;
  --border: #dbe4df;
  --danger: #a32828;
  --warning-bg: #fff7df;
  --warning-border: #e4c35f;
  --error-bg: #ffecec;
  --error-border: #dc8c8c;
  --success-bg: #eaf7ee;
  --success-border: #8dc79c;
  --info-bg: #eef7f2;
  --info-border: #b7d7c5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary-dark); }
a:hover { text-decoration: none; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  font-weight: 700;
  font-size: 1.08rem;
  color: #fff;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.site-header nav a:hover {
  background: rgba(255,255,255,.15);
}

.main { padding: 28px 0 42px; }
.site-footer { padding: 18px 0; color: var(--muted); }

h1 { margin: 0 0 20px; font-size: clamp(1.7rem, 3vw, 2.35rem); }
h2 { margin-top: 0; }

.hero, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.button, button.button {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.button:hover { background: var(--primary-dark); }
.button.secondary { background: #e8eee9; color: var(--text); }
.button.secondary:hover { background: #d8e3dc; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  margin: 0 0 16px;
}
.alert-error { background: var(--error-bg); border-color: var(--error-border); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.alert-success { background: var(--success-bg); border-color: var(--success-border); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--primary-dark);
}
.stat-card span { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #edf3ef; }
tr:hover td { background: #fafcfb; }
code, pre { background: #edf3ef; border-radius: 6px; }
code { padding: 2px 5px; }
pre { padding: 12px; overflow-x: auto; }
.sha { display: inline-block; max-width: 250px; overflow-wrap: anywhere; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-narrow { max-width: 460px; }
.span-2 { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }
.checkbox-line { flex-direction: row; align-items: center; gap: 8px; }
.checkbox-line input { width: auto; }
.hint { color: var(--muted); font-weight: 400; font-size: .92rem; }
.form-actions { display: flex; gap: 10px; align-items: center; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions form { display: inline; }
.link-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 18px; }
.inline-filter { margin: 0; }
.muted { color: var(--muted); }
.file-list { padding-left: 20px; }

.menu-toggle { display: none; }

@media (max-width: 850px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .header-inner { align-items: flex-start; padding: 12px 0; flex-direction: column; }
  .menu-toggle {
    display: inline-block;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    padding: 8px 10px;
    border-radius: 8px;
  }
  .admin-menu { display: none !important; flex-direction: column; align-items: stretch !important; width: 100%; }
  .admin-menu.open { display: flex !important; }
  .site-header nav:not(.admin-menu) { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .container { width: min(100% - 20px, 1180px); }
  .stats-grid { grid-template-columns: 1fr; }
  .hero, .card { padding: 16px; }
  th, td { padding: 8px; }
}
fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
legend {
  font-weight: 700;
  padding: 0 6px;
}
.checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}
@media (max-width: 850px) {
  .checkbox-list { grid-template-columns: 1fr; }
}

/* Page publique de téléchargement */
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .82rem;
}
.release-hero h1 {
  margin-bottom: 8px;
}
.release-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr);
  gap: 18px;
  align-items: center;
}
.version-number {
  display: inline-block;
  margin: 4px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #edf3ef;
  color: var(--primary-dark);
  font-size: 1.6rem;
  font-weight: 700;
}
.release-meta p {
  margin: 4px 0;
}
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.download-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fbfdfc;
}
.download-card h3 {
  margin-top: 0;
}
.download-card code {
  overflow-wrap: anywhere;
}
.form-key {
  max-width: 680px;
}
@media (max-width: 850px) {
  .release-summary,
  .download-grid {
    grid-template-columns: 1fr;
  }
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.document-card {
    border: 1px solid var(--border, #d8dee9);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
}

.document-card h3 {
    margin-top: 0;
}

/* Page publique application — mise en page compacte */
.public-app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: stretch;
  background: linear-gradient(135deg, #ffffff 0%, #eef5f0 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
}
.public-app-hero h1 {
  margin-bottom: 8px;
}
.hero-description {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
}
.hero-version-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: var(--primary);
  color: #fff;
  border-radius: 16px;
  padding: 18px;
  min-height: 130px;
}
.hero-version-card span,
.hero-version-card small {
  opacity: .88;
}
.hero-version-card strong {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}
.hero-version-card-muted {
  background: #e8eee9;
  color: var(--text);
}
.public-release-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr);
  gap: 18px;
  align-items: start;
}
.public-main-column,
.public-sidebar {
  min-width: 0;
}
.public-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side-card,
.compact-card,
.download-panel {
  margin-bottom: 14px;
}
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.side-card h2,
.compact-card h2,
.download-panel h2 {
  margin-bottom: 12px;
}
.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.section-heading-row h2 {
  margin: 0;
}
.channel-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf3ef;
  color: var(--primary-dark);
  font-weight: 700;
}
.download-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.download-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.download-card-primary {
  border-color: rgba(46, 107, 79, .28);
  background: #f7fbf8;
}
.download-card h3 {
  margin-bottom: 6px;
}
.file-meta {
  margin-bottom: 0;
}
.full-width {
  width: 100%;
  text-align: center;
}
.hash-details,
.technical-details {
  color: var(--muted);
  font-size: .92rem;
}
.hash-details summary,
.technical-details summary {
  cursor: pointer;
  font-weight: 700;
}
.hash-details code,
.technical-details code,
.link-box code {
  display: block;
  margin-top: 6px;
  padding: 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.clean-list {
  margin-bottom: 0;
  padding-left: 1.2rem;
}
.clean-list li + li {
  margin-top: 6px;
}
.notes-box {
  color: var(--text);
}
.meta-list {
  margin: 0;
}
.meta-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.meta-list div:last-child {
  border-bottom: 0;
}
.meta-list dt {
  color: var(--muted);
  font-weight: 700;
}
.meta-list dd {
  margin: 0;
  font-weight: 700;
}
.document-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.document-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdfc;
}
.document-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.document-item p {
  margin: 0 0 10px;
  color: var(--muted);
}
.link-box {
  margin-bottom: 12px;
}
.link-box p {
  margin: 0;
}
.technical-details {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .public-app-hero,
  .public-release-layout {
    grid-template-columns: 1fr;
  }
  .hero-version-card {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .public-app-hero {
    padding: 16px;
    border-radius: 14px;
  }
  .side-card {
    padding: 16px;
  }
  .section-heading-row {
    flex-direction: column;
  }
  .channel-pill {
    justify-content: flex-start;
  }
  .meta-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}


/* Règle de choix pack complet / patch */
.download-advice {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #cfe0d5;
  border-radius: 12px;
  background: #f3faf5;
}
.download-advice h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.download-advice ul {
  margin: 0;
  padding-left: 1.2rem;
}
.download-advice li + li {
  margin-top: 6px;
}
