/* La Carte Eternelle — final release cleanup
   Dark mode must stay predominantly black, with white/gray text and borders.
   Light mode is untouched and keeps the native light UI. */

/* The historical People flow still creates its own dark “Ajouter un proche”.
   Keep only the canonical section action. */
html body #people .people-section-create-row,
html body #people .people-section-add-person{
  display:none!important;
}

/* Detail pages must not keep a white sheet around dark content. */
html[data-lce-theme="dark"] body.lce-v10-detail,
html[data-lce-theme="dark"] body.lce-v10-detail main,
html[data-lce-theme="dark"] body.lce-v10-detail main>.page.active,
html[data-lce-theme="dark"] body.lce-v10-detail main>.page.active>div:not(#lce-v10-detailbar){
  background-color:#000!important;
  color:#fff!important;
}
html[data-lce-theme="dark"] body.lce-v10-detail #lce-v10-detailbar{
  background:transparent!important;
}

/* Global form controls in dark mode. */
html[data-lce-theme="dark"] body form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-lce-theme="dark"] body form textarea,
html[data-lce-theme="dark"] body form select{
  background:#0d0d0f!important;
  background-image:none!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.34)!important;
  box-shadow:none!important;
  caret-color:#fff!important;
}
html[data-lce-theme="dark"] body form input::placeholder,
html[data-lce-theme="dark"] body form textarea::placeholder{
  color:#8e8e93!important;
  opacity:1!important;
}
html[data-lce-theme="dark"] body form label,
html[data-lce-theme="dark"] body form legend{
  color:#e5e5ea!important;
}
html[data-lce-theme="dark"] body form input:focus,
html[data-lce-theme="dark"] body form textarea:focus,
html[data-lce-theme="dark"] body form select:focus{
  outline:none!important;
  border-color:rgba(255,255,255,.78)!important;
  box-shadow:0 0 0 3px rgba(255,255,255,.08)!important;
}
html[data-lce-theme="dark"] body input[type="date"],
html[data-lce-theme="dark"] body input[type="datetime-local"]{
  color-scheme:dark!important;
}

/* Proches — complete add/edit form. */
html[data-lce-theme="dark"] body .people-complete-back{
  background:rgba(0,0,0,.82)!important;
  -webkit-backdrop-filter:blur(18px)!important;
  backdrop-filter:blur(18px)!important;
}
html[data-lce-theme="dark"] body .people-complete-modal{
  background:#0b0b0c!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.34)!important;
  box-shadow:0 30px 100px rgba(0,0,0,.72)!important;
}
html[data-lce-theme="dark"] body .people-complete-modal h1,
html[data-lce-theme="dark"] body .people-complete-modal h2,
html[data-lce-theme="dark"] body .people-complete-modal h3,
html[data-lce-theme="dark"] body .people-complete-section b,
html[data-lce-theme="dark"] body .people-complete-photo-copy b{
  color:#fff!important;
}
html[data-lce-theme="dark"] body .people-complete-section{
  background:transparent!important;
  border-color:rgba(255,255,255,.22)!important;
}
html[data-lce-theme="dark"] body .people-complete-section small,
html[data-lce-theme="dark"] body .people-complete-photo-copy small{
  color:#a1a1a6!important;
}
html[data-lce-theme="dark"] body .people-complete-form label{
  color:#d1d1d6!important;
}
html[data-lce-theme="dark"] body .people-complete-form input:not([type="file"]):not([type="hidden"]),
html[data-lce-theme="dark"] body .people-complete-form textarea,
html[data-lce-theme="dark"] body .people-complete-form select{
  background:#101012!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.34)!important;
}
html[data-lce-theme="dark"] body .people-complete-form input::placeholder,
html[data-lce-theme="dark"] body .people-complete-form textarea::placeholder{
  color:#8e8e93!important;
}
html[data-lce-theme="dark"] body .people-complete-photo{
  background:#151517!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.28)!important;
}
html[data-lce-theme="dark"] body .people-complete-photo-preview{
  background:#0d0d0f!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.34)!important;
}
html[data-lce-theme="dark"] body .people-complete-photo-actions button,
html[data-lce-theme="dark"] body .people-complete-modal .lce-close{
  background:#111113!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.36)!important;
}
html[data-lce-theme="dark"] body .people-complete-submit{
  background:#f5f5f7!important;
  color:#050505!important;
  border-color:#fff!important;
}

/* Journal & Letters — guided-writing panel and both forms. */
html[data-lce-theme="dark"] body #journal,
html[data-lce-theme="dark"] body #journal.page,
html[data-lce-theme="dark"] body #journal .panel{
  background:#000!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.28)!important;
}
html[data-lce-theme="dark"] body #journal #depth-journal-prompts.journal-prompts-v3{
  background:#0b0b0c!important;
  background-image:none!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.30)!important;
  box-shadow:none!important;
}
html[data-lce-theme="dark"] body #journal .journal-prompt-head-v3 h3,
html[data-lce-theme="dark"] body #journal .journal-prompt-v3{
  color:#fff!important;
}
html[data-lce-theme="dark"] body #journal .journal-prompt-head-v3 p,
html[data-lce-theme="dark"] body #journal .journal-keyword-help-v3{
  color:#a1a1a6!important;
}
html[data-lce-theme="dark"] body #journal .journal-prompt-count-v3,
html[data-lce-theme="dark"] body #journal .journal-prompt-v3{
  background:#111113!important;
  border-color:rgba(255,255,255,.30)!important;
  box-shadow:none!important;
}
html[data-lce-theme="dark"] body #journal .journal-prompt-v3 span:last-child{
  color:#d1d1d6!important;
}
html[data-lce-theme="dark"] body #journal .journal-media-v1,
html[data-lce-theme="dark"] body #journal .journal-media-row-v1,
html[data-lce-theme="dark"] body #journal .lce-entry,
html[data-lce-theme="dark"] body #journal .journal-card-v2{
  background:#0d0d0f!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.28)!important;
  box-shadow:none!important;
}
html[data-lce-theme="dark"] body #journal .journal-media-head-v1 b,
html[data-lce-theme="dark"] body #journal .journal-card-v2 h3{
  color:#fff!important;
}
html[data-lce-theme="dark"] body #journal .journal-media-head-v1 small{
  color:#a1a1a6!important;
}

/* Heritage — eliminate the remaining white frame/sheet around the overview. */
html[data-lce-theme="dark"] body[data-lce-detail="legacy"],
html[data-lce-theme="dark"] body[data-lce-detail="legacy"] main,
html[data-lce-theme="dark"] body[data-lce-detail="legacy"] #legacy,
html[data-lce-theme="dark"] body[data-lce-detail="legacy"] #legacy.page,
html[data-lce-theme="dark"] body[data-lce-detail="legacy"] .legacy-overview-v2{
  background:#000!important;
  color:#fff!important;
}
html[data-lce-theme="dark"] body #legacy .legacy-hero-v2,
html[data-lce-theme="dark"] body #legacy .legacy-progress-card-v2,
html[data-lce-theme="dark"] body #legacy .legacy-card-v2,
html[data-lce-theme="dark"] body #legacy .legacy-note-v2{
  background:#0d0d0f!important;
  background-image:none!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.30)!important;
  box-shadow:none!important;
}
html[data-lce-theme="dark"] body #legacy .legacy-progress-top-v2 b,
html[data-lce-theme="dark"] body #legacy .legacy-card-v2 h3,
html[data-lce-theme="dark"] body #legacy .legacy-hero-v2 h1{
  color:#fff!important;
}
html[data-lce-theme="dark"] body #legacy .legacy-card-stats-v2 span,
html[data-lce-theme="dark"] body #legacy .legacy-state-v2,
html[data-lce-theme="dark"] body #legacy .legacy-icon-v2{
  background:#171719!important;
  color:#e5e5ea!important;
  border-color:rgba(255,255,255,.28)!important;
}
html[data-lce-theme="dark"] body #legacy .legacy-progress-track-v2{
  background:#2c2c2e!important;
}
html[data-lce-theme="dark"] body #legacy .legacy-progress-fill-v2{
  background:#f5f5f7!important;
}

/* Keep the dark-mode canonical add button visibly actionable. */
html[data-lce-theme="dark"] body #lce-people-create-top .lce-section-create-btn,
html[data-lce-theme="dark"] body #lce-memory-create-top .lce-section-create-btn{
  background:#f5f5f7!important;
  color:#050505!important;
  border-color:#fff!important;
}
