/* Palette reprise de la Collection (fond #0b0d12, accent #8ea9c9) pour que
   les applis de la maison se ressemblent. */
:root {
  color-scheme: dark;
  --ink-950: #0b0d12;
  --ink-900: #11141b;
  --ink-850: #161a23;
  --ink-800: #1c212c;
  --ink-700: #272e3d;
  --ink-600: #3a4356;
  --ink-400: #7b869c;
  --ink-300: #a3adc0;
  --ink-100: #e6eaf2;
  --accent: #8ea9c9;
  --accent-soft: #8ea9c926;
  --rose: #f0a0b4;
  --rose-soft: #f0a0b422;
  --vert: #7fd1a8;
  --vert-soft: #7fd1a822;
  --ambre: #e8c07a;
  --ambre-soft: #e8c07a22;
  --rouge: #f08a8a;
  --rayon: 14px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-950);
  color: var(--ink-100);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.page { max-width: 780px; margin: 0 auto; padding: 24px 16px 64px; }
.page-etroite { max-width: 420px; padding-top: 12vh; }

.entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.entete h1 { margin: 0; font-size: 1.55rem; font-weight: 650; letter-spacing: -0.01em; }
.sous-titre { margin: 4px 0 0; color: var(--ink-400); font-size: 0.9rem; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo img { width: 34px; height: 34px; }

.carte {
  background: var(--ink-900);
  border: 1px solid var(--ink-700);
  border-radius: var(--rayon);
  padding: 16px;
}

/* ---------- Formulaires ---------- */
label { display: block; font-size: 0.8rem; color: var(--ink-300); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink-100);
  background: var(--ink-850);
  border: 1px solid var(--ink-700);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.ligne { display: flex; gap: 10px; }
.ligne > * { flex: 1; min-width: 0; }
.aide { font-size: 0.8rem; color: var(--ink-400); margin: 6px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 0.9rem; font-weight: 550;
  color: var(--ink-100);
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--ink-700); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-principal { background: var(--accent); border-color: var(--accent); color: var(--ink-950); }
.btn-principal:hover { background: #a5bcd8; }
.btn-fantome { background: transparent; border-color: transparent; color: var(--ink-300); }
.btn-fantome:hover { background: var(--ink-800); }
.btn-danger { color: var(--rouge); }
.btn-petit { padding: 5px 10px; font-size: 0.8rem; }
.btn-plein { width: 100%; margin-top: 18px; padding: 11px; }

.erreur { color: var(--rouge); font-size: 0.85rem; margin: 10px 0 0; min-height: 1.2em; }

/* ---------- Onglets ---------- */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--ink-700); margin-bottom: 16px; }
.onglet {
  font: inherit; font-size: 0.9rem; color: var(--ink-400);
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px; cursor: pointer;
}
.onglet[aria-selected="true"] { color: var(--ink-100); border-bottom-color: var(--accent); }

.barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.compteur { color: var(--ink-400); font-size: 0.85rem; }

/* ---------- Éléments ---------- */
.liste { display: grid; gap: 10px; }
.element {
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  background: var(--ink-900);
  border: 1px solid var(--ink-700);
  border-left: 3px solid var(--tone, var(--ink-600));
  border-radius: var(--rayon);
  padding: 14px 16px;
}
.element[data-priorite="1"] { --tone: var(--rose); }
.element[data-priorite="2"] { --tone: var(--accent); }
.element[data-priorite="3"] { --tone: var(--ink-600); }
.element.est-pris { opacity: 0.62; }
.element.est-a-moi { opacity: 1; border-color: var(--vert); border-left-color: var(--vert); background: linear-gradient(90deg, var(--vert-soft), var(--ink-900) 40%); }
.element-corps { min-width: 0; flex: 1; }
.element-titre { margin: 0; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.element-titre a { color: var(--ink-100); text-decoration: none; border-bottom: 1px dashed var(--ink-600); }
.element-titre a:hover { border-bottom-color: var(--accent); }
.element-infos { color: var(--ink-400); font-size: 0.8rem; margin-top: 2px; overflow-wrap: anywhere; }
.element-note { color: var(--ink-300); font-size: 0.88rem; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.element-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.element-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--ink-800); color: var(--ink-300);
  border: 1px solid var(--ink-700);
}
.badge-prix { color: var(--ink-100); }
.badge-p1 { background: var(--rose-soft); color: var(--rose); border-color: transparent; }
.badge-p2 { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-collection { background: var(--ambre-soft); color: var(--ambre); border-color: transparent; text-decoration: none; }
.badge-pris { background: var(--ink-800); color: var(--ink-300); }
.badge-moi { background: var(--vert-soft); color: var(--vert); border-color: transparent; }
.badge-revoque { color: var(--rouge); }

.vide { text-align: center; color: var(--ink-400); padding: 40px 16px; border: 1px dashed var(--ink-700); border-radius: var(--rayon); }

/* ---------- Invités ---------- */
.invite {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--ink-900); border: 1px solid var(--ink-700); border-radius: var(--rayon); padding: 12px 14px;
}
.invite.revoque { opacity: 0.55; }
.invite-nom { font-weight: 600; }
.invite-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lien-copie { font-size: 0.78rem; color: var(--ink-400); width: 100%; overflow-wrap: anywhere; }

.encart {
  background: var(--accent-soft); color: var(--ink-300);
  border-radius: var(--rayon); padding: 12px 14px; font-size: 0.85rem; margin-bottom: 16px;
}

/* ---------- Dialogue ---------- */
dialog {
  width: min(520px, calc(100vw - 32px));
  background: var(--ink-900); color: var(--ink-100);
  border: 1px solid var(--ink-700); border-radius: 18px; padding: 20px;
}
dialog::backdrop { background: #0008; backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 4px; font-size: 1.15rem; }
.dialogue-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink-800); color: var(--ink-100); border: 1px solid var(--ink-600);
  padding: 10px 16px; border-radius: 12px; font-size: 0.9rem;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 10;
  max-width: calc(100vw - 32px);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erreur-toast { border-color: var(--rouge); color: var(--rouge); }

.interrupteur { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-300); font-size: 0.85rem; margin: 0; cursor: pointer; }
.interrupteur input { width: auto; }

@media (max-width: 560px) {
  .element { flex-direction: column; }
  .element-actions { flex-direction: row; align-self: stretch; justify-content: flex-end; }
  .entete { flex-direction: column; }
}

.titre-page { margin: 0 0 4px; font-size: 1.35rem; font-weight: 650; }
.espace-bas { margin-bottom: 16px; }
.centre { text-align: center; }
.aide.centre { margin-top: 16px; }
.champ-invite { flex: 1; min-width: 180px; width: auto; }
.champ-duree { width: auto; }
.badge-expire { color: var(--ambre); }
.souvenir { margin-top: 14px; }
.souvenir .aide { margin: 0; }
