/* Appli téléphone sur une colonne ; vêtements posés sur des vignettes claires façon catalogue ; la tenue du jour est une carte à faire glisser, pièces disposées de la tête aux pieds. */
:root {
  --bg: #EDEFF3;
  --surface: #FFFFFF;
  --tile: #F6F5F2;
  --fg: #1B2130;
  --muted: #5D6575;
  --line: #D8DCE3;
  --accent: #6B2D5C;
  --accent-soft: #F1E3EE;
  --on-accent: #FFFFFF;
  --danger: #B3261E;
  --ok: #1F7A4D;
  --ok-soft: #E3F2EA;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #13151B; --surface: #1C1F27; --tile: #ECEAE5; --fg: #ECEEF3; --muted: #9CA3B0;
    --line: #2D313D; --accent: #D891C8; --accent-soft: #3A2436; --on-accent: #1E0F1A;
    --danger: #F2938C; --ok: #7FD1A6; --ok-soft: #173126; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
.wrap {
  max-width: 560px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(20px + env(safe-area-inset-top, 0px)) calc(110px + env(safe-area-inset-bottom, 0px));
}
.vue { display: flex; flex-direction: column; gap: 20px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.fort { font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tete { display: flex; flex-direction: column; gap: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.field {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: 12px; padding: 12px 13px; font: inherit; font-size: 16px;
}
.btn {
  border: 0; border-radius: 999px; padding: 14px 20px; font-weight: 700; font-size: 16px;
  background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.quiet { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); color: var(--surface); }
.btn.full { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 auto; }
.erreur { color: var(--danger); font-size: 15px; }
.aide { font-size: 13px; color: var(--muted); font-weight: 400; }
.notice { background: var(--accent-soft); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* Accueil */
.accueil { display: flex; flex-direction: column; gap: 24px; padding-top: calc(48px + env(safe-area-inset-top, 0px)); }
.marque { display: flex; flex-direction: column; gap: 10px; }
.marque h1 { font-size: 40px; }
.bascule { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.bascule button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 10px; font-weight: 600; color: var(--muted); }
.bascule button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.formulaire label, .carte-reglage label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }

/* Contexte du jour */
.contexte { display: flex; flex-direction: column; gap: 8px; }
.ligne-contexte {
  display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 13px; font-size: 15px;
}
.ligne-contexte .ico { flex: none; width: 22px; height: 22px; color: var(--accent); }
.ligne-contexte b { font-weight: 700; }
.ligne-contexte .lien { margin-left: auto; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; padding: 0; white-space: nowrap; }
.evenements { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evenements span { overflow: hidden; text-overflow: ellipsis; }

/* Carte du matin */
.pile { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.carte {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px;
  display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 2;
}
.pile::after {
  content: ""; position: absolute; inset: 10px 10px -8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; z-index: 1; opacity: 0.6;
}
.pile.derniere::after { display: none; }
.carte.glisse { transition: none; }
@media (prefers-reduced-motion: no-preference) {
  .carte { transition: transform 0.25s ease, opacity 0.25s ease; }
}
.carte .haut-carte { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.points { display: flex; gap: 6px; }
.points span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.points span.actif { background: var(--accent); }
.silhouette { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.silhouette .rang { display: flex; gap: 8px; justify-content: center; width: 100%; }
.vignette {
  background: var(--tile); border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  aspect-ratio: 1; max-width: 100%;
}
.vignette img { width: 90%; height: 90%; object-fit: contain; pointer-events: none; }
.rang-haut .vignette { width: 38%; }
.rang-haut.seul .vignette { width: 50%; }
.rang-bas .vignette { width: 42%; aspect-ratio: 4 / 5; }
.rang-pieds .vignette { width: 28%; aspect-ratio: 4 / 3; }
.carte .conseil { font-size: 16px; }
.actions-carte { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.portee { background: var(--ok-soft); border-radius: 14px; padding: 12px 14px; color: var(--ok); font-weight: 700; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.portee button { border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; padding: 0; }
.attente { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; padding: 40px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
@media (prefers-reduced-motion: no-preference) {
  .attente .cintre { animation: balance 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
  @keyframes balance { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
}

.precision summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; }
.precision-corps { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* Armoire */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ajout {
  border: 1.5px dashed var(--line); background: var(--surface); border-radius: 16px;
  padding: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; width: 100%;
}
.ajout strong { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
.facons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.facon { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.facon b { color: var(--accent); font-size: 15px; }
.facon span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.type { border: 2px solid transparent; background: var(--surface); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; min-width: 0; }
.type svg { width: 100%; aspect-ratio: 1; }
.type[aria-pressed="true"] { border-color: var(--accent); }
.apercu-catalogue { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: 14px; padding: 10px; }
.apercu-catalogue .vignette { width: 84px; flex: none; }
.apercu-catalogue .vignette svg { width: 82%; height: 82%; }
.file { display: flex; flex-direction: column; gap: 8px; }
.file:empty { display: none; }
.file-item { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px; border: 1px solid var(--line); font-size: 14px; }
.file-item .vignette { width: 52px; flex: none; border-radius: 8px; }
.file-item.erreur { color: var(--danger); }
.groupes { display: flex; flex-direction: column; gap: 22px; }
.groupe { display: flex; flex-direction: column; gap: 10px; }
.groupe h2 { display: flex; align-items: baseline; gap: 8px; font-size: 17px; }
.groupe h2 span { font-family: var(--font-body); font-size: 14px; color: var(--muted); font-weight: 500; }
.grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.piece { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.piece .nom { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece .a-verifier { position: absolute; top: 6px; left: 6px; background: var(--fg); color: var(--bg); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.vide { background: var(--surface); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); }
.vide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Étiquette de vêtement */
.etiquette {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  padding: 4px 9px 4px 7px; border-radius: 4px 9px 9px 4px; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.etiquette::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bg); flex: none; }

/* Réglages */
.carte-reglage { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.resultats { display: flex; flex-direction: column; }
.resultats button { border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; padding: 11px 2px; }
.resultats button span { color: var(--muted); font-size: 14px; }
.aide-agenda summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; }
.aide-agenda dl { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.aide-agenda dt { font-weight: 700; margin-top: 6px; }
.aide-agenda dd { margin: 0; }

/* Mon style */
.chip .pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); margin-right: 6px; vertical-align: -1px; }
.inspirations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inspiration { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.inspiration img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--tile); }
.inspiration p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.inspiration button { align-self: flex-start; border: 0; background: none; color: var(--danger); font-size: 13px; font-weight: 600; padding: 0; }
.invitation-style { display: flex; flex-direction: column; gap: 10px; background: var(--accent-soft); border-radius: 16px; padding: 16px; }

/* Favoris */
.coeur { border: 0; background: none; padding: 4px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 50%; }
.coeur svg { width: 24px; height: 24px; }
.coeur[aria-pressed="true"] { color: var(--accent); }
.coeur[aria-pressed="true"] path { fill: currentColor; }
.favori { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.favori .silhouette .vignette { border-radius: 10px; }
.favori .rang-haut .vignette, .favori .rang-bas .vignette { width: 26%; }
.favori .rang-pieds .vignette { width: 20%; }

/* Statistiques */
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chiffre { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.chiffre b { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chiffre span { font-size: 12.5px; color: var(--muted); }
.liste-pieces { display: flex; flex-direction: column; gap: 8px; }
.ligne-piece { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; border-left-width: 1px; }
.ligne-piece .vignette { width: 52px; flex: none; border-radius: 8px; }
.ligne-piece div { min-width: 0; display: flex; flex-direction: column; }
.ligne-piece b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-piece span { font-size: 13px; color: var(--muted); }
.ligne-piece .valeur { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; flex: 1; }
.barre i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.ligne-couleur { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ligne-couleur > span:first-child { width: 92px; flex: none; }
.ligne-couleur .part { width: 40px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendrier span { aspect-ratio: 1; border-radius: 6px; background: var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.calendrier .porte { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.calendrier .top { background: var(--accent); color: var(--on-accent); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* Composer sa tenue */
.choix-pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choix-pieces .piece { border: 2px solid transparent; border-radius: 14px; padding: 2px; }
.choix-pieces .piece[aria-pressed="true"] { border-color: var(--accent); }
.choix-pieces .piece[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.composition { background: var(--surface); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.composition .rang-haut .vignette, .composition .rang-bas .vignette { width: 26%; }
.composition .rang-pieds .vignette { width: 20%; }
.avis { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.liens-carte { display: flex; justify-content: center; gap: 22px; }

/* Photo en grand (fond sombre fixe, quel que soit le thème) */
.visionneuse {
  position: fixed; inset: 0; z-index: 40; background: #0c0d10; display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  gap: 12px; color: #f3f3f5;
}
.visionneuse .barre-haut { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.visionneuse .barre-haut b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visionneuse .fermer { border: 0; background: #2a2c33; color: #f3f3f5; border-radius: 999px; padding: 9px 16px; font-weight: 700; flex: none; }
.visionneuse .scene { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; border-radius: 16px; touch-action: pinch-zoom pan-x pan-y; }
.visionneuse .scene.claire { background: #f6f5f2; }
.visionneuse .scene img { max-width: 100%; max-height: 100%; object-fit: contain; }
.visionneuse .scene.zoom { align-items: flex-start; justify-content: flex-start; }
.visionneuse .scene.zoom img { max-width: none; max-height: none; width: 220%; }
.visionneuse .choix { display: flex; justify-content: center; gap: 8px; }
.visionneuse .choix button { border: 1px solid #3a3d46; background: transparent; color: #f3f3f5; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.visionneuse .choix button[aria-pressed="true"] { background: #f3f3f5; color: #0c0d10; }
.visionneuse p { text-align: center; font-size: 13px; color: #a7aab3; margin: 0; }
.vignette.agrandir { cursor: zoom-in; }

/* Ma tenue en photo */
.piece-detectee { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.piece-detectee .vignette { width: 84px; flex: none; }
.piece-detectee .details { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.piece-detectee .details .field { padding: 8px 10px; font-size: 15px; }
.piece-detectee.ecartee { opacity: 0.45; }
.photo-tenue { width: 100%; max-height: 40vh; object-fit: contain; border-radius: 14px; background: var(--tile); cursor: zoom-in; }

/* Lien discret sous la carte */
.lien-discret { border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; padding: 4px 0; align-self: center; }

/* Bilan du soir */
.bilan { background: var(--surface); border: 2px solid var(--accent); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.bilan .question { display: flex; flex-direction: column; gap: 8px; }
.bilan .question > span { font-weight: 700; font-size: 15px; }
.bilan .silhouette .vignette { border-radius: 10px; }
.bilan .rang-haut .vignette { width: 24%; }
.bilan .rang-bas .vignette { width: 24%; }
.bilan .rang-pieds .vignette { width: 18%; }

/* Barre d'onglets */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  display: flex; justify-content: center; gap: 6px;
}
.onglets button { flex: 1 1 0; max-width: 160px; border: 0; background: transparent; border-radius: 12px; padding: 10px 4px; font-weight: 700; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.onglets button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* Fiche vêtement */
.voile { position: fixed; inset: 0; z-index: 20; background: rgba(10, 12, 18, 0.5); display: flex; align-items: flex-end; justify-content: center; }
.fiche {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; border-radius: 22px 22px 0 0;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.fiche .vignette { width: 100%; max-width: 260px; align-self: center; }
.fiche label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.coches { display: flex; flex-wrap: wrap; gap: 8px; }
.coches label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; max-width: calc(100% - 32px);
}
