/* Marchés publics : palette doom-nord, comme les autres pages de cipherbliss.com */
:root {
  --bg: #2e3440; --bg-alt: #272c36; --base4: #434c5e; --base5: #4c566a; --base6: #9099ab;
  --fg: #eceff4; --fg-alt: #d8dee9; --cyan: #88c0d0; --teal: #8fbcbb; --green: #a3be8c; --yellow: #ebcb8b;
  --orange: #d08770; --magenta: #b48ead;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg-alt); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--cyan); text-decoration-color: var(--base5); }
a:hover { color: var(--teal); }
code { color: var(--yellow); background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; font-size: .86em; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.entete, main, .pied { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.entete { padding-top: 32px; }
.entete h1 { margin: 0 0 .3rem; color: var(--fg); font-size: 2.2rem; }
.entete h1 span { color: var(--cyan); }
.entete p { margin: 0 0 1.4rem; color: var(--base6); }
.recherche { background: var(--bg-alt); border: 1px solid var(--base4); border-radius: 12px; padding: 16px; }
.recherche__q input { width: 100%; padding: 12px 14px; font-size: 1.1rem; border-radius: 10px; border: 1px solid var(--base5); background: var(--bg); color: var(--fg); }
.recherche__q input:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
.filtres { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 14px; font-size: .92rem; }
.filtres label, .filtres fieldset { display: flex; flex-direction: column; gap: 4px; color: var(--base6); }
.filtres fieldset { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 10px; }
.filtres legend { width: 100%; padding: 0; margin-bottom: 2px; }
.filtres fieldset label, .filtres .case { flex-direction: row; align-items: center; gap: 6px; color: var(--fg-alt); }
.filtres input[type=text], .filtres input[type=number], .filtres input[type=date], .filtres select {
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--base5); background: var(--bg); color: var(--fg); font: inherit; }
.aide { margin: 12px 0 0; color: var(--base6); font-size: .85rem; }
.soutien { margin: 12px 0 0; padding: 12px 16px; background: var(--bg-alt); border: 1px solid var(--base4); border-left: 3px solid var(--yellow); border-radius: 12px; color: var(--base6); font-size: .9rem; }
.soutien a { display: inline-block; margin-top: 4px; color: var(--yellow); font-weight: 600; }
.etat { margin: 18px 0 4px; color: var(--fg); font-weight: 600; }
.flux-recherche { margin: 0 0 10px; font-size: .9rem; }
.flux-recherche a { margin-right: 10px; }
.rss::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .35em; border-radius: 2px; background: var(--orange); vertical-align: -.05em; }
.muted { color: var(--base6); }
.resultats { list-style: none; padding: 0; margin: 0; }
.avis { background: var(--bg-alt); border: 1px solid var(--base4); border-left: 4px solid var(--cyan); border-radius: 10px; padding: 12px 16px; margin: 0 0 10px; }
.avis--clos { border-left-color: var(--base5); }
.avis h3 { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.35; }
.avis h3 a { color: var(--fg); text-decoration: none; }
.avis h3 a:hover { color: var(--cyan); text-decoration: underline; }
.avis__meta { margin: 0; color: var(--base6); font-size: .9rem; }
.avis__meta strong { color: var(--fg-alt); }
.avis__faits { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.badge { padding: 2px 9px; border-radius: 999px; background: var(--base4); font-size: .82rem; }
.badge--ouvert { background: rgba(163, 190, 140, .22); color: var(--green); }
.badge--source { background: rgba(180, 142, 173, .22); color: var(--purple, #b48ead); font-weight: 600; }
.avis__sources h4 { margin: .6rem 0 .2rem; font-size: .9rem; }
.avis__sources ul { margin: 0; padding-left: 1.2rem; font-size: .88rem; }
.badge--montant { background: rgba(235, 203, 139, .2); color: var(--yellow); font-weight: 600; }
.avis__lots { margin-top: 8px; font-size: .9rem; }
.avis__lots summary { cursor: pointer; color: var(--cyan); }
.avis__lots ul { margin: 6px 0 0; padding-left: 1.2rem; }
.avis__desc { margin: 8px 0 0; color: var(--base6); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.plus { display: block; margin: 16px auto; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--cyan); background: transparent; color: var(--cyan); font: inherit; cursor: pointer; }
.plus[hidden] { display: none; }
.plus:hover { background: var(--cyan); color: var(--bg); }
.flux { margin: 40px 0; }
.flux h2 { color: var(--fg); }
.flux ul { padding-left: 1.2rem; }
.pied { margin-top: 2rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--base4); color: var(--base6); font-size: .86rem; }
.boite-filtres summary { margin-top: 12px; color: var(--cyan); cursor: pointer; font-size: .92rem; }
.copier { margin-left: 8px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--base5); background: transparent; color: var(--base6); font: inherit; font-size: .82rem; cursor: pointer; }
.copier:hover { color: var(--fg); border-color: var(--cyan); }
/* statistiques */
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.onglets a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--base5); text-decoration: none; color: var(--fg-alt); font-size: .92rem; }
.onglets a[aria-current] { background: var(--cyan); border-color: var(--cyan); color: var(--bg); }
.filtres-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; font-size: .92rem; }
.filtres-stats label { display: flex; flex-direction: column; gap: 4px; color: var(--base6); }
.filtres-stats input, .filtres-stats select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--base5); background: var(--bg); color: var(--fg); font: inherit; }
.bloc { margin: 26px 0; }
.bloc h2 { color: var(--fg); margin-bottom: 4px; }
.bloc h3 { color: var(--fg); margin: 22px 0 6px; font-size: 1.05rem; }
.tableau { overflow-x: auto; position: relative; margin: 8px 0; }
.tableau table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th { text-align: left; color: var(--base6); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--base4); white-space: nowrap; }
.tableau td { padding: 6px 8px; border-bottom: 1px solid var(--bg-alt); vertical-align: top; position: relative; }
.tableau .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.barre { display: block; height: 4px; margin-top: 3px; margin-left: auto; border-radius: 2px; background: var(--cyan); opacity: .7; }
.pastille { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: rgba(163, 190, 140, .22); color: var(--green); font-size: .75rem; }
.commune { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--base4); }
.commune p { margin: 4px 0; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.chiffre { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--base4); }
.chiffre strong { color: var(--fg); font-size: 1.4rem; }

/* favoris et discussions */
.avis { position: relative; }
.favori { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--base6); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.favori--on, .favori:hover { color: var(--yellow); }
.avis h3 { padding-right: 34px; }
.favoris-bouton { display: inline-block; margin: 0 0 10px; padding: 4px 14px; font-size: .9rem; }
.discussion { margin-top: 10px; font-size: .92rem; }
.discussion summary { cursor: pointer; color: var(--cyan); }
.discussion__corps { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--base4); }
.messages { list-style: none; margin: 0; padding: 0; }
.messages .messages { margin-left: 16px; padding-left: 10px; border-left: 2px solid var(--base4); }
.message { margin: 0 0 10px; }
.message__tete { margin: 0; }
.message__tete .pastille { margin-left: 6px; }
.message__texte { margin: 2px 0; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.lien { border: 0; background: none; color: var(--cyan); padding: 0; font: inherit; font-size: .85rem; cursor: pointer; }
.discussion__form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.discussion__form label { display: flex; flex-direction: column; gap: 4px; color: var(--base6); }
.discussion__form input, .discussion__form select, .discussion__form textarea { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--base5); background: var(--bg-alt); color: var(--fg); font: inherit; }
.discussion__ligne { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.discussion__form .envoyer { margin: 0; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.petit { font-size: .8rem; margin: 0; }

/* mise en page : recherche à gauche des résultats sur grand écran */
.onglet-stats { border-color: var(--cyan) !important; color: var(--cyan) !important; font-weight: 600; }
@media (min-width: 1000px) {
  .entete, .pied { max-width: 1320px; }
  main.mise-en-page { max-width: 1320px; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
  .colonne-recherche { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .colonne-recherche .filtres { grid-template-columns: 1fr; }
  .colonne-resultats .etat { margin-top: 0; }
}
.colonne-resultats { min-width: 0; }
/* histogramme des avis par jour */
.histogramme { margin: 8px 0 14px; }
.histogramme figcaption { font-size: .82rem; color: var(--base6); margin-bottom: 4px; }
.histogramme__barres { display: flex; align-items: flex-end; gap: 2px; height: 70px; padding-bottom: 16px; position: relative; }
.histogramme__barre { flex: 1; min-width: 3px; background: var(--cyan); opacity: .75; border-radius: 2px 2px 0 0; position: relative; }
.histogramme__barre:hover, .histogramme__barre:focus { opacity: 1; outline: none; }
.histogramme__barre.est-weekend { background: var(--base6); }
.histogramme__axe { position: absolute; bottom: 0; font-size: .7rem; color: var(--base6); }
/* liens de l'avis et partage */
.avis__docs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-size: .88rem; }
.avis__docs a::before { content: "↗ "; color: var(--base6); }
.avis__docs a.doc-dce { font-weight: 600; }
.avis__actions { display: flex; gap: 12px; margin-top: 8px; font-size: .85rem; }
.compris { margin: 10px 0 0; color: var(--base6); font-size: .85rem; line-height: 1.9; }
.compris code { margin: 0 .1em; }
.aide-avancee { margin-top: 10px; font-size: .85rem; }
.aide-avancee summary { cursor: pointer; color: var(--cyan); }
.aide-avancee dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 8px 0 0; align-items: baseline; }
.aide-avancee dt { margin: 0; }
.aide-avancee dd { margin: 0; color: var(--base6); }
.aide-avancee button { font: inherit; font-family: ui-monospace, monospace; font-size: .82rem; color: var(--yellow); background: var(--bg); border: 1px solid var(--base5); border-radius: 6px; padding: 2px 6px; cursor: pointer; text-align: left; }
.aide-avancee button:hover { border-color: var(--yellow); }
.avis h3 mark { background: rgba(235, 203, 139, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 640px) { .aide-avancee dl { grid-template-columns: 1fr; } .aide-avancee dd { margin-bottom: 6px; } }
/* sélection d'avis → marchés passés sur les mêmes sujets */
.selection-case { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-alt); font-size: .88rem; cursor: pointer; }
.selection-case input { accent-color: var(--yellow); }
.selection-barre { position: fixed; z-index: 20; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  max-width: calc(100vw - 32px); padding: 10px 16px; background: var(--bg-alt); border: 1px solid var(--yellow); border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); color: var(--fg); }
.selection-barre[hidden] { display: none; }
.selection-barre .plus { margin: 0; }
.similaires-tete { list-style: none; margin: 0 0 14px; }
.similaires-tete p { margin: 0 0 6px; font-size: .9rem; }
.avis--attribution { border-left-color: var(--green); }
.badge--titulaire { background: rgba(163, 190, 140, .18); color: var(--green); }
a .badge--titulaire:hover { background: rgba(163, 190, 140, .15); }
.avis__proche { font-size: .85rem; margin: 6px 0; }
body { padding-bottom: 72px; }
.selection-barre .plus { width: auto; padding: 8px 14px; border-radius: 10px; }
@media (max-width: 640px) {
  .selection-barre { left: 12px; right: 12px; bottom: 12px; transform: none; max-width: none; justify-content: space-between; }
}
/* alertes et tableau de bord des envois */
.alertes, .admin-envois { max-width: 900px; margin: 0 auto; padding: 0 16px 32px; }
.bouton { display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--base4); color: inherit; font-weight: 600; text-decoration: none; }
.liste-alertes li { margin: 6px 0; }
.alerte-lien { margin-left: 10px; }
.tableau-defilant { overflow-x: auto; }
#envois { width: 100%; border-collapse: collapse; font-size: .88rem; }
#envois th, #envois td { padding: 6px 8px; border-bottom: 1px solid var(--base4); text-align: left; vertical-align: top; }
#envois .envoi-echec { background: rgba(191, 97, 106, .14); }
.statut--refuse, .statut--erreur, .statut--rebond { color: #bf616a; font-weight: 600; }
.statut--differe { color: #ebcb8b; }
