/* Ayur·Hermès — thème « quatre éléments ».
   Le fond sombre et l'or restent la signature. Chaque profil reçoit en plus la couleur de son élément dominant :
   braise pour le Feu, ciel pour l'Air, turquoise pour l'Eau, vert tendre pour la Terre.
   Les doshas ont chacun leur teinte (Vata ciel, Pitta safran, Kapha jade). */
:root {
  --text: #F6F1E7;
  --muted: #CFC3A8;
  --muted-2: #9C9076;
  --card: #15120E;
  --card-2: #1D1913;
  --feu: #F0673A;
  --air: #8FC2F2;
  --eau: #27B8AE;
  --terre: #8FBA5A;
  --vata: #8FC2F2;
  --pitta: #F58A3C;
  --kapha: #3FC19A;
  --el: #C9A962;
  --el-rgb: 201, 169, 98;
  --radius: 20px;
}
body[data-el="feu"] { --el: var(--feu); --el-rgb: 240, 103, 58; }
body[data-el="air"] { --el: var(--air); --el-rgb: 143, 194, 242; }
body[data-el="eau"] { --el: var(--eau); --el-rgb: 39, 184, 174; }
body[data-el="terre"] { --el: var(--terre); --el-rgb: 143, 186, 90; }

body {
  background:
    radial-gradient(1000px 520px at 50% -160px, rgba(var(--el-rgb), .24), transparent 70%),
    radial-gradient(700px 520px at 105% 104%, rgba(var(--el-rgb), .12), transparent 70%),
    radial-gradient(600px 420px at -10% 60%, rgba(201, 169, 98, .07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color .4s;
}

/* Titres et repères dans la couleur de l'élément */
.kicker, .q-part, .meal .type { color: var(--el); }
.orn::before { background: linear-gradient(90deg, transparent, rgba(var(--el-rgb), .55)); }
.orn::after { background: linear-gradient(90deg, rgba(var(--el-rgb), .55), transparent); }
.orn h2 { position: relative; padding: 0 .2rem; }
.principle h2, .streak-box .n, .stepper output, .bar-row .meta .val { color: var(--text); }
.principle { border-color: rgba(var(--el-rgb), .45); }
.principle h2 { color: var(--el); }
.why { border-left-color: var(--el); color: var(--text); }
h3.aisle { color: var(--el); }
a { color: var(--gold-2); }

/* Cartes : coin marqué, liseré coloré */
.card {
  border-radius: var(--radius);
  border-color: rgba(var(--el-rgb), .22);
  background:
    linear-gradient(160deg, rgba(var(--el-rgb), .07), transparent 42%),
    linear-gradient(180deg, var(--card-2), var(--card));
}
.card.flat { background: rgba(var(--el-rgb), .06); border-color: rgba(var(--el-rgb), .25); }
.meal { overflow: hidden; }
.meal::before { content: ""; width: 4px; align-self: stretch; background: linear-gradient(180deg, var(--el), transparent); flex: none; }
.meal .thumb { border-radius: 50% 50% 50% 14px; border-color: rgba(var(--el-rgb), .5); }

/* Progression et choix */
.progress > span { background: linear-gradient(90deg, var(--gold), var(--el)); box-shadow: 0 0 14px rgba(var(--el-rgb), .5); }
.opt { border-radius: 18px; border-color: rgba(201, 169, 98, .26); }
.opt .letter { border-radius: 9px; transform: rotate(45deg); width: 28px; height: 28px; margin: 0 .2rem; }
.opt .letter { font-size: 0; }
.opt .letter::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-line); }
.opt.chosen { border-color: var(--el, var(--gold-2)); background: rgba(var(--el-rgb), .14); box-shadow: 0 0 0 1px rgba(var(--el-rgb), .45), 0 0 26px rgba(var(--el-rgb), .25); }
.opt.chosen .letter { background: var(--gold); border-color: var(--gold); }
.opt.chosen .letter::after { background: #140F08; }
.obj.on { border-color: var(--el); background: rgba(var(--el-rgb), .13); box-shadow: 0 0 22px rgba(var(--el-rgb), .22); }
.chip.on { background: var(--el); border-color: var(--el); }
body:not([data-el]) .chip.on, body[data-el=""] .chip.on { background: var(--gold); border-color: var(--gold); }

/* Doshas : une teinte chacun */
.bar.vata > span { background: linear-gradient(90deg, #3E6C99, var(--vata)); }
.bar.pitta > span { background: linear-gradient(90deg, #A04A14, var(--pitta)); }
.bar.kapha > span { background: linear-gradient(90deg, #1B6E57, var(--kapha)); }
.bar.feu > span { background: linear-gradient(90deg, #8E3216, var(--feu)); }
.bar.air > span { background: linear-gradient(90deg, #3E6C99, var(--air)); }
.bar.eau > span { background: linear-gradient(90deg, #0F6660, var(--eau)); }
.bar.terre > span { background: linear-gradient(90deg, #4C6B26, var(--terre)); }
.pill.d-vata { border-color: rgba(143, 194, 242, .6); color: var(--vata); }
.pill.d-pitta { border-color: rgba(245, 138, 60, .6); color: var(--pitta); }
.pill.d-kapha { border-color: rgba(63, 193, 154, .6); color: var(--kapha); }
.dosha-row .medal { border-radius: 50% 50% 50% 12px; }

/* Anneau des doshas */
.donut-wrap { position: relative; width: 190px; height: 190px; margin: .2rem auto .6rem; }
.donut { width: 100%; height: 100%; }
.donut .track { fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: 13; }
.donut .arc { fill: none; stroke-width: 13; stroke-linecap: butt; }
.donut .arc.vata { stroke: var(--vata); }
.donut .arc.pitta { stroke: var(--pitta); }
.donut .arc.kapha { stroke: var(--kapha); }
.donut .arc.score { stroke: var(--el); stroke-linecap: round; }
.donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; }
.donut-mid svg { width: 46px; height: 46px; stroke: var(--el); fill: none; stroke-width: 1.4; filter: drop-shadow(0 0 10px rgba(var(--el-rgb), .7)); }
.donut-mid span { font-family: var(--font-serif); font-size: 1.15rem; }
.donut-wrap.small { width: 110px; height: 110px; margin: 0; flex: none; }
.donut-wrap.small .donut-mid { flex-direction: row; align-items: center; justify-content: center; gap: .1rem; }
.donut-wrap.small b { font-family: var(--font-serif); font-size: 2rem; font-variant-numeric: lining-nums; }
.phrase { text-align: center; font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; color: var(--gold-2); margin: 0 0 .9rem; }

/* Éléments : chaque carte porte sa couleur */
.el-card { border-radius: 18px 18px 18px 4px; }
.el-card.support { border-color: var(--gold-2); }
.el-card.dominant { border-color: var(--el); box-shadow: 0 0 26px rgba(var(--el-rgb), .3); }
.el-card.dominant .tag { background: var(--el); color: #140F08; border-color: var(--el); }

/* Accueil : les quatre glyphes en couleur, anneaux */
.glyph-row .g:nth-child(1) { color: var(--feu); border-color: rgba(240, 103, 58, .5); background: rgba(240, 103, 58, .1); }
.glyph-row .g:nth-child(2) { color: var(--air); border-color: rgba(143, 194, 242, .5); background: rgba(143, 194, 242, .1); }
.glyph-row .g:nth-child(3) { color: var(--eau); border-color: rgba(39, 184, 174, .5); background: rgba(39, 184, 174, .1); }
.glyph-row .g:nth-child(4) { color: var(--terre); border-color: rgba(143, 186, 90, .5); background: rgba(143, 186, 90, .1); }
.glyph-row .g { width: 52px; height: 52px; border-radius: 16px; transform: rotate(45deg); }
.glyph-row .g svg { transform: rotate(-45deg); }
.glyph-row { gap: 1.5rem; margin: 1rem 0 1.7rem; }
.logo-ring { position: relative; }
.logo-ring::before, .logo-ring::after {
  content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 1px dashed rgba(201, 169, 98, .35);
  animation: tourne 40s linear infinite;
}
.logo-ring::after { inset: -34px; border-style: solid; border-color: rgba(201, 169, 98, .12); animation-duration: 70s; animation-direction: reverse; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Navigation et jours */
.nav-btn.active { color: var(--text); }
.nav-btn.active svg { stroke: var(--el); filter: drop-shadow(0 0 6px rgba(var(--el-rgb), .7)); }
.nav-btn.active::before { background: var(--el); box-shadow: 0 0 10px var(--el); }
.day-chip { border-radius: 14px 14px 14px 4px; }
.day-chip.on { background: linear-gradient(160deg, var(--gold-2), var(--gold)); }
.cal .day { border-radius: 12px 12px 12px 3px; }
.cal .day.today { border-color: var(--el); box-shadow: 0 0 0 1px var(--el), 0 0 16px rgba(var(--el-rgb), .4); }
.tile svg { stroke: var(--el); }
.resume-banner .medal { border-radius: 50% 50% 50% 12px; border-color: rgba(var(--el-rgb), .6); }

/* Partage */
.share-panel { margin: 1.2rem 0 .4rem; padding: 1rem; border-radius: var(--radius); border: 1px solid rgba(var(--el-rgb), .4);
  background: linear-gradient(140deg, rgba(var(--el-rgb), .16), rgba(201, 169, 98, .05)); }
.share-panel .share-row { margin-top: .6rem; }
.btn.wa { background: linear-gradient(180deg, #3BD671, #1FA855); border-color: #3BD671; color: #06210F; box-shadow: 0 6px 22px rgba(37, 211, 102, .2); }
.btn.wa:hover { text-decoration: none; filter: brightness(1.05); }

/* Lecture complète */
.guide h3 { color: var(--el); font-size: 1.15rem; margin: 1.1rem 0 .3rem; }
.guide h3:first-child { margin-top: 0; }
.guide.locked { overflow: hidden; }
.veil-lock { margin: 1rem -1.15rem -1.1rem; padding: 1.2rem 1.15rem 1.2rem; border-top: 1px dashed rgba(var(--el-rgb), .45);
  background: linear-gradient(180deg, rgba(var(--el-rgb), .12), rgba(10, 9, 8, .2)); }
.veil-lock p { margin: 0; color: var(--text); }

/* À deux */
.duo-invite { border-color: var(--gold-2); display: block; }
.duo-invite h2 { margin: 0 0 .3rem; }
.duo-pair { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.mini { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; }
.mini .medal { width: 58px; height: 58px; border-radius: 50%; background-size: cover; border: 1px solid var(--gold-line); }
.mini strong { overflow-wrap: anywhere; }
.mini .bar { width: 100%; height: 5px; margin-top: 3px; }
.friend { display: flex; align-items: center; gap: .4rem; padding: .5rem .6rem; }
.friend a { flex: 1; display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; min-height: 56px; }
.friend .medal { width: 46px; height: 46px; border-radius: 50%; background-size: cover; border: 1px solid var(--gold-line); flex: none; }
.friend p { margin: 0; }
.friend .score { margin-left: auto; font-family: var(--font-serif); font-size: 1.5rem; color: var(--el); font-variant-numeric: lining-nums; white-space: nowrap; }
.friend .swap { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold-line); background: transparent; color: var(--muted); flex: none; }

/* Badges */
.badges .badge-row { display: flex; justify-content: center; gap: 1rem; margin: .5rem 0 .6rem; }
.badge {
  width: 86px; height: 86px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed rgba(201, 169, 98, .3); color: var(--muted-2);
}
.badge .n { font-family: var(--font-serif); font-size: 2rem; line-height: 1; font-variant-numeric: lining-nums; }
.badge .l { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; }
.badge.won {
  border: 2px solid var(--gold-2); color: #140F08;
  background: radial-gradient(circle at 35% 28%, #FFF1C2, var(--gold-2) 40%, var(--gold) 75%, #9A7B3A);
  box-shadow: 0 0 26px rgba(201, 169, 98, .45), inset 0 -4px 10px rgba(0, 0, 0, .18);
}

/* Mot du jour */
.mot blockquote { margin: .2rem 0 .7rem; font-family: var(--font-serif); font-style: italic; font-size: 1.5rem; line-height: 1.25; color: var(--text); }
.mot-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.mot { border-left: 4px solid var(--el); border-radius: 6px var(--radius) var(--radius) 6px; }

@media (prefers-reduced-motion: reduce) { .logo-ring::before, .logo-ring::after { animation: none; } }
@media print {
  .share-panel, .veil-lock, .badges .share-row { display: none !important; }
  .guide h3 { color: #000 !important; }
  body { background: #fff !important; }
}

/* Six onglets */
.nav.on { grid-template-columns: repeat(6, 1fr); }
.nav-btn { font-size: .62rem; letter-spacing: 0; }
@media (min-width: 420px) { .nav-btn { font-size: .68rem; } }

/* Entraînement LHCS */
.lh-global { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem; }
.lh-global .bar { flex: 1; }
.lh-global .bar > span { background: linear-gradient(90deg, var(--gold), var(--el)); }
.lh-card { display: block; }
.lh-mod { display: flex; align-items: center; gap: 1rem; }
.lh-mod h3 { margin: 0 0 .2rem; }
.lh-mod .fine { margin: 0; }
.lh-mod.locked { opacity: .5; }
.lh-mod .donut-wrap.small b { font-size: 1.5rem; }
.lh-mod small { font-size: .8rem; }
.lh-d2 { border-style: dashed; border-color: var(--gold-2); }
.lh-journal { margin: .75rem 0; }
.lh-steps { list-style: none; margin: 1rem 0; padding: 0; }
.lh-steps li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--gold-dim); }
.lh-steps .n { flex: none; width: 32px; height: 32px; border-radius: 9px; transform: rotate(45deg); border: 1px solid rgba(var(--el-rgb), .6);
  display: flex; align-items: center; justify-content: center; color: var(--el); font-family: var(--font-serif); margin: .2rem .3rem 0; }
.lh-steps .n { font-size: 0; }
.lh-steps li { counter-increment: pas; }
.lh-steps .n::after { content: counter(pas); transform: rotate(-45deg); font-size: 1rem; }
.lh-steps p { margin: .15rem 0 0; }
.lh-run { text-align: center; border-color: var(--el); box-shadow: 0 0 40px rgba(var(--el-rgb), .25); }
.lh-clock { font-family: var(--font-serif); font-size: 5rem; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; color: var(--text); margin: .3rem 0 .6rem;
  text-shadow: 0 0 30px rgba(var(--el-rgb), .6); }
.lh-txt { font-family: var(--font-serif); font-size: 1.3rem; margin: 1.1rem 0 .4rem; }
.center-chips { justify-content: center; }
.lh-dots { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .6rem; }
.lh-dot { width: 34px; height: 34px; border-radius: 10px 10px 10px 3px; border: 1px solid var(--gold-line); display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: var(--muted-2); font-variant-numeric: lining-nums; }
.lh-dot.on { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #140F08; border-color: transparent; font-weight: 600; }
.lh-dot.today { box-shadow: 0 0 0 1px var(--el); }
.lh-crit.ok { border-color: var(--ok); }
.lh-crit.ok .kicker { color: var(--ok); }
.lh-crit p { margin: 0; }
.lh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .4rem 0 .2rem; text-align: center; }
.lh-stats div { border: 1px solid rgba(var(--el-rgb), .3); border-radius: 14px; padding: .6rem .3rem; background: rgba(var(--el-rgb), .06); }
.lh-stats b { display: block; font-family: var(--font-serif); font-size: 1.9rem; line-height: 1; font-variant-numeric: lining-nums; }
.lh-stats span { font-size: .7rem; color: var(--muted); }
.lh-add { display: flex; gap: .5rem; align-items: center; }
.lh-add input { flex: 1; min-width: 0; }
.lh-def { display: flex; align-items: center; gap: .3rem; padding: .35rem 0; border-bottom: 1px solid var(--gold-dim); }
.lh-def .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lh-def .cat { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--gold-line); background: transparent; color: var(--muted); flex: none; }
.lh-def .cat.on { background: var(--el); color: #140F08; border-color: var(--el); font-weight: 600; }
.lh-def .cat.del { border-color: transparent; color: var(--muted-2); }
.lh-count { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lh-count .stepper { margin: .3rem 0; }
.bar.indifferent > span { background: var(--muted-2); }
.field textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--gold-line); border-radius: 12px; padding: .6rem .8rem; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* Recherche d'aliment en vue */
.quick-food { margin: .2rem 0 1.1rem; padding: .9rem 1rem 1rem; border-radius: var(--radius); border: 1px solid var(--gold-2);
  background: linear-gradient(140deg, rgba(201, 169, 98, .14), rgba(var(--el-rgb), .08)); }
.quick-food label { display: flex; align-items: center; gap: .5rem; font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; margin-bottom: .5rem; }
.quick-food label svg { width: 22px; height: 22px; stroke: var(--gold-2); fill: none; stroke-width: 1.8; }
.quick-food input { width: 100%; min-height: 52px; font-size: 1.05rem; background: var(--bg); border: 1px solid var(--gold); border-radius: 999px; padding: .5rem 1.1rem; }
.quick-food input:focus { outline: none; box-shadow: 0 0 0 3px rgba(201, 169, 98, .3); }
.quick-food .fine { margin: .5rem 0 0; }
.quick-food .food-list { margin: .5rem 0 0; }
.topbar .icon-btn.find { margin-right: .4rem; border-color: var(--gold-2); background: rgba(201, 169, 98, .12); }
.btn.ghost svg { stroke: currentColor; }

/* Fiches recettes détaillées (3.2) */
.rec-intro { font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.55; margin: .4rem 0 .8rem; color: var(--text); }
.rec-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 1rem; }
.chip { display: inline-block; font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; background: var(--card-2); color: var(--muted); border: 1px solid rgba(255,255,255,.08); }
.chip.new { background: var(--gold); color: #140F08; border-color: var(--gold); font-weight: 600; }
.chip.v-chauffant { color: var(--feu); border-color: rgba(245,138,60,.5); }
.chip.v-rafraîchissant { color: var(--eau); border-color: rgba(143,194,242,.5); }
.rec-tips li { margin-bottom: .5rem; }
.rec-adapt .adapt { padding: .7rem 0; border-top: 1px solid rgba(255,255,255,.07); }
.rec-adapt .adapt:first-of-type { border-top: 0; }
.rec-adapt .adapt p { margin: .4rem 0 0; }
.rec-adapt .adapt.you { background: rgba(var(--el-rgb, 212,175,55), .08); border-radius: 12px; padding: .7rem .8rem; border-top: 0; margin-bottom: .3rem; }
.rec-adapt .chip.new { margin-left: .4rem; }
.pair-link { display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; }
.pair-img { flex: 0 0 64px; height: 64px; border-radius: 12px; background-size: cover; background-position: center; }

/* Sous-titre du nom (3.2) */
.welcome .kind { margin: -.2rem 0 .4rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.topbar .brand .kind { display: block; font-family: var(--font-sans); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-top: 1px; }
