/* Page « Transparence » - s'appuie sur canvas.css (bandeau, boutons, fenêtre de connexion) ; DA de Hey : papier, encre, bleus de l'app,
   post-it jaunes, titres Caveat, séparateurs en tirets comme le site principal. Pensée pour un écran d'ordinateur. */
body.tp { background: var(--paper); }
.tp-main { max-width: 1320px; margin: 0 auto; padding: 0 40px 60px; }
html { scroll-behavior: smooth; }

.hero { padding: 48px 0 28px; max-width: 880px; }
.hero h1 { font-family: "Caveat", cursive; font-size: 84px; line-height: 1; color: var(--blue-800); transform: rotate(-1.5deg); transform-origin: left; }
.hero p { margin-top: 18px; font-size: 20px; }
.hero .status { font-size: 15px; color: var(--ink-soft); }
.hero .status.error { color: var(--error); }

/* Sections séparées par des tirets, comme les écrans du site principal */
.block { padding: 40px 0 36px; border-top: 2px dashed var(--paper-card); scroll-margin-top: 70px; }
.block-head { max-width: 860px; margin-bottom: 18px; }
.block-head h2 { font-family: "Caveat", cursive; font-size: 54px; line-height: 1.05; color: var(--blue-800); display: flex; align-items: center; gap: 14px; }
.block-head p { margin-top: 8px; font-size: 17px; color: var(--ink-soft); }
.block-head .summary { font-size: 18px; font-weight: 600; color: var(--ink); }
.sub { font-family: "Caveat", cursive; font-size: 34px; color: var(--ink); margin: 22px 0 10px; }

.ico { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.ico svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .ico { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.chip .ico, .chip img { width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px; }

.toolbar-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--blue-100); background: #fff; color: var(--blue-800);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
}
.chip.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

.v-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #2e8b57; color: #fff; font-size: 13px; font-weight: 700; vertical-align: middle; }

/* Zone qui défile à l'intérieur de la section (la page garde son propre défilement) */
.scroll-box {
  max-height: 620px; overflow-y: auto; overscroll-behavior: auto; padding: 18px; background: rgba(255,255,255,.55);
  border: 2px solid var(--paper-card); scrollbar-width: thin;
}
.scroll-box::-webkit-scrollbar { width: 10px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--blue-100); border-radius: 8px; }
.stack { display: grid; gap: 34px; max-width: 1000px; margin: 0 auto; padding-top: 34px; }
.empty { color: var(--ink-soft); font-style: italic; padding: 8px 0; }

/* ---------- Idées ---------- */
.idea-board { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.idea-board .kept { grid-column: 1 / -1; }
.idea-col h3 { font-family: "Caveat", cursive; font-size: 36px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.idea-col h3::after { content: ""; flex: 1; height: 4px; background: #d9f24a; border-radius: 4px; transform: rotate(-0.6deg); }
.postit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 24px; padding: 6px; }
.postit {
  position: relative; padding: 16px 16px 26px; min-height: 150px; border: none; text-align: left; font: inherit; color: var(--ink);
  cursor: pointer; box-shadow: 2px 5px 10px rgba(0,0,0,.16); transition: transform .15s ease; background: var(--postit);
}
.postit:hover { transform: rotate(0deg) scale(1.03) !important; z-index: 2; }
.postit h4 { font-size: 17px; line-height: 1.25; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.postit p { font-size: 14.5px; color: #3d3d39; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.postit .v-badge { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; font-size: 16px; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.postit .cat-logo { position: absolute; right: 8px; bottom: 6px; width: 26px; height: 26px; opacity: .9; }
.postit.poll::after { content: "Sondage"; position: absolute; left: 12px; bottom: 6px; font-size: 11px; color: var(--ink-soft); }

/* ---------- Cartes (nouveautés, investissements, dépenses) ---------- */
.card { background: #fff; border: 1px solid var(--paper-card); padding: 22px 26px; position: relative; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { background: var(--blue-800); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.tag.light { background: var(--blue-50); color: var(--blue-800); }
.card-date { font-size: 13px; color: var(--ink-soft); margin-right: auto; }
.card h3 { font-size: 26px; font-weight: 700; margin-bottom: 8px; color: #1f2a37; }
.card .desc { white-space: pre-line; font-size: 16px; color: #374151; }
.card-body { display: flex; gap: 22px; align-items: flex-start; }
.card-body.left { flex-direction: row-reverse; }
.card-body > .txt { flex: 6; }
.card-body > .imgs { flex: 4; display: grid; gap: 10px; }
.imgs img { width: 100%; border: 5px solid #d2d2d2; background: #eee; display: block; }
.card.with-notes { margin-top: 56px; padding-top: 52px; }
.card-notes { position: absolute; left: 16px; top: -58px; display: flex; }
.note-mini {
  width: 132px; height: 92px; padding: 9px 10px; margin-right: -22px; box-shadow: 2px 4px 8px rgba(0,0,0,.18); font-size: 12.5px; font-weight: 700; line-height: 1.25;
  cursor: pointer; border: none; text-align: left; font-family: inherit; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}
.card-admin { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--paper-card); }
.progress { margin-top: 16px; }
.progress-bar { height: 16px; background: #e8e6dc; border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--blue-600); border-radius: 999px; }
.progress-label { display: flex; justify-content: space-between; margin-top: 6px; font-size: 14px; color: var(--ink-soft); }

/* ---------- Dépenses ---------- */
.budget-top { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.donut-wrap svg { display: block; }
.donut-label { font-family: "Caveat", cursive; font-weight: 700; fill: var(--ink); }
.legend { display: grid; gap: 8px; min-width: 260px; flex: 1; max-width: 420px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.legend-row .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.legend-row .name { flex: 1; }
.cat-chip { display: inline-flex; flex-direction: column; background: #fff; border-radius: 14px; border: 3px solid; padding: 8px 14px; cursor: pointer; font: inherit; text-align: left; }
.cat-chip.active { background: var(--blue-50); }
.cat-chip small { color: var(--ink-soft); }
.exp-row { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--paper-card); border-left: 8px solid; padding: 14px 18px; cursor: pointer; text-align: left; font: inherit; width: 100%; }
.exp-row:hover { background: var(--blue-50); }
.exp-row .txt { flex: 1; }
.exp-row .t { font-weight: 700; font-size: 17px; }
.exp-row .m { font-size: 13px; color: var(--ink-soft); }
.exp-row .amt { font-family: "Caveat", cursive; font-size: 30px; color: var(--blue-800); white-space: nowrap; }
.ring { width: 54px; height: 54px; flex: none; }

/* ---------- Soutenir ---------- */
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 24px; }
.tile { background: #fff; border: 1px solid var(--paper-card); padding: 18px 20px; }
.tile .value { font-family: "Caveat", cursive; font-size: 42px; line-height: 1; color: var(--blue-800); }
.tile .label { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.panel { background: #fff; border: 1px solid var(--paper-card); padding: 22px 26px; margin-bottom: 22px; }
.panel h3 { font-family: "Caveat", cursive; font-size: 34px; color: var(--blue-800); margin-bottom: 8px; }
.panel p { font-size: 16px; margin-bottom: 10px; }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.panel input[type=text], .panel input[type=email], .panel input[type=number], .panel input[type=date], .panel textarea, .panel select, .form input, .form textarea, .form select {
  font: inherit; font-size: 15px; padding: 9px 12px; border: 2px solid var(--paper-card); border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
}
.panel textarea, .form textarea { min-height: 90px; resize: vertical; }
.banner { background: #fff1c9; color: #5b4300; padding: 14px 18px; margin-bottom: 20px; font-size: 15px; }
.fund { display: grid; grid-template-columns: minmax(260px, 330px) 1fr; gap: 36px; align-items: start; }
.fund-item { margin-bottom: 18px; }
.fund-item .head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.fund-item .head .dot { width: 14px; height: 14px; border-radius: 50%; }
.fund-item input[type=range] { width: 100%; }
.fund-item .small { font-size: 13px; color: var(--ink-soft); }
.link-btn { background: none; border: none; color: var(--blue-600); cursor: pointer; font: inherit; font-size: 13px; padding: 2px 0; text-decoration: underline; }
.survey-q { margin-bottom: 18px; }
.survey-q > .q { font-weight: 700; margin-bottom: 8px; }
.stat-bar { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 14px; }
.stat-bar .lab { width: 190px; }
.stat-bar .bar { flex: 1; height: 12px; background: #e8e6dc; border-radius: 999px; overflow: hidden; }
.stat-bar .bar > span { display: block; height: 100%; background: var(--blue-600); }

.foot { display: flex; justify-content: space-between; gap: 16px; padding: 24px 40px 40px; max-width: 1320px; margin: 0 auto; color: var(--ink-soft); font-size: 14px; }

/* ---------- Fenêtres ---------- */
.dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.dialog { position: relative; background: #fff; width: min(760px, 100%); max-height: 90vh; overflow: auto; padding: 28px 30px; box-shadow: 4px 8px 24px rgba(0,0,0,.35); }
.dialog.postit-dialog { background: var(--postit); transform: rotate(-0.5deg); }
.dialog h3 { font-family: "Caveat", cursive; font-size: 40px; line-height: 1.05; margin-bottom: 6px; color: var(--blue-800); }
.dialog .meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.dialog .body { white-space: pre-line; font-size: 17px; }
.dialog-close { position: absolute; top: 8px; right: 14px; background: none; border: none; font-size: 32px; cursor: pointer; color: var(--ink); }
.form label { display: block; font-size: 13px; color: var(--ink-soft); margin: 12px 0 4px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .error { color: var(--error); font-size: 14px; margin-top: 10px; }
.form .actions { margin-top: 18px; justify-content: flex-end; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.thumbs .thumb { position: relative; width: 96px; height: 96px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border: 3px solid #d2d2d2; }
.thumbs button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--error); color: #fff; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatches button.active { border-color: var(--ink); }
.note-edit { border: 1px dashed var(--paper-card); padding: 10px; margin-top: 10px; }

@media (max-width: 980px) {
  .tp-main { padding: 0 18px 40px; }
  .hero h1 { font-size: 46px; overflow-wrap: anywhere; }
  .block-head h2 { font-size: 38px; }
  .idea-board, .fund { grid-template-columns: 1fr; }
  .card-body { flex-direction: column !important; }
  .card-notes { position: static; flex-wrap: wrap; margin-bottom: 14px; }
  .note-mini { margin-right: 8px; }
  .foot { padding: 20px 18px 30px; flex-direction: column; }
  .form .two { grid-template-columns: 1fr; }
}

/* ---------- Frise « Réalisé » : cartes plus petites, une fois à gauche, une fois à droite de la ligne ---------- */
.timeline { position: relative; display: grid; gap: 44px; max-width: 1000px; margin: 0 auto; padding: 34px 0 10px; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; background: var(--blue-100); transform: translateX(-50%); }
.timeline:empty::before, .timeline > .empty:only-child { display: none; }
.timeline .card { width: calc(50% - 30px); padding: 16px 18px; }
.timeline .card.left { justify-self: start; }
.timeline .card.right { justify-self: end; }
.timeline .card::after { content: ""; position: absolute; top: 26px; width: 16px; height: 16px; border-radius: 50%; background: var(--blue-600); border: 4px solid #f1efe8; }
.timeline .card.left::after { right: -41px; }
.timeline .card.right::after { left: -41px; }
.timeline .card.with-notes { margin-top: 56px; padding-top: 52px; }
.timeline .card h3 { font-size: 21px; }
.timeline .card .desc { font-size: 14.5px; }
.timeline .card-body { flex-direction: column !important; gap: 12px; }
.timeline .imgs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.timeline .note-mini { width: 112px; height: 80px; font-size: 11.5px; }

/* ---------- Financer : montant tapé au centre du graphe ---------- */
.donut-input { position: relative; width: 260px; height: 260px; margin: 0 auto; }
.donut-input .center-input { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
.donut-input .center-input input {
  pointer-events: auto; width: 130px; border: none; border-bottom: 2px dashed var(--paper-card); background: transparent; text-align: center;
  font-family: "Caveat", cursive; font-size: 46px; font-weight: 700; color: var(--ink); padding: 0; border-radius: 0; outline: none;
}
.donut-input .center-input input:focus { border-bottom-color: var(--blue-600); }
.donut-input .center-input span { font-family: "Caveat", cursive; font-size: 46px; font-weight: 700; }
.fund-item input[type=range] { touch-action: pan-y; cursor: grab; height: 28px; }
.fund-item input[type=range]:active { cursor: grabbing; }

@media (max-width: 980px) {
  .timeline::before { left: 14px; }
  .timeline .card { width: calc(100% - 40px); justify-self: end !important; }
  .timeline .card.left::after, .timeline .card.right::after { left: -34px; right: auto; }
}

.sub-fund { margin: 6px 0 4px 14px; padding-left: 10px; border-left: 2px dashed rgba(0,0,0,.18); }
.sub-fund[hidden] { display: none; }
.sub-row { margin-bottom: 8px; }

/* Post-it « idée d'origine » DERRIÈRE la carte : le fond blanc passe par-dessus les post-it, qui dépassent seulement par le haut. */
.card.with-notes { isolation: isolate; background: none; border: none; }
.card.with-notes::before { content: ""; position: absolute; inset: 0; background: #fff; border: 1px solid var(--paper-card); z-index: 1; }
.card.with-notes > .card-notes { z-index: 0; }
.card.with-notes > :not(.card-notes) { position: relative; z-index: 2; }
@media (max-width: 980px) {
  .card.with-notes > .card-notes { position: relative; z-index: 2; }
}

/* --- Une page par rubrique : on n'affiche que la section de la page, et le défilement redevient celui de la page --- */
.tp[class*="only-"] .block { display: none; }
.only-idees #idees, .only-nouveautes #nouveautes, .only-investissements #investissements, .only-depenses #depenses, .only-soutenir #soutenir { display: block; border-top: 0; padding-top: 8px; }
.tp[class*="only-"] .block-head h2, .tp[class*="only-"] .block-head > p:not(.summary) { display: none; }
.tp[class*="only-"] .scroll-box { max-height: none; overflow: visible; background: none; border: 0; padding: 0; }
.tp[class*="only-"] .hero { padding-bottom: 4px; }
.tp[class*="only-"] .hero h1 { transform: none; font-size: clamp(48px, 7vw, 84px); }
.tp[class*="only-"] .hero p { color: var(--ink-soft); }

/* ---------- Images flottantes dans le texte (au lieu de deux colonnes) + agrandissement au clic ---------- */
.card-body, .timeline .card-body { display: block; }
.card-body::after { content: ""; display: block; clear: both; }
.card-body > .imgs { float: right; width: 40%; margin: 4px 0 10px 20px; display: grid; gap: 8px; }
.card-body.left > .imgs { float: left; margin: 4px 20px 10px 0; }
.timeline .card-body > .imgs { width: 46%; grid-template-columns: 1fr; }
.imgs img { cursor: zoom-in; }
.dialog.wide { width: min(1100px, 100%); padding: 40px 20px 20px; }
.zoom-img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; }
@media (max-width: 520px) {
  .card-body > .imgs, .card-body.left > .imgs, .timeline .card-body > .imgs { float: none; width: 100%; margin: 0 0 12px; }
}
