/* Forme — jetons cburnettweb : crème / encre / or, Georgia + Segoe UI */
:root {
  --ink: #181512; --soft: #6b6259; --line: #e2dbd1; --bg: #f4f1ec; --card: #ffffff;
  --gold: #b3823c; --gold-c: #f5ecdd; --pale: #b8b0a5; --green: #3d7a4e; --green-c: #e6f0e8;
  --rouge: #a4342c; --rouge-c: #f6e4e2;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --r: 14px; --r-sm: 9px;
  --ombre: 0 1px 2px rgba(24,21,18,.04), 0 8px 24px rgba(24,21,18,.06);
  --nav-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- en-tête + navigation ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244,241,236,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 18px; }
.brand { font-family: var(--serif); font-size: 22px; display: flex; align-items: baseline; gap: 8px; }
.brand b { color: var(--gold); font-weight: normal; }
.brand small { font-family: var(--sans); font-size: 12px; color: var(--soft); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav button { border: 0; background: none; padding: 8px 12px; border-radius: 999px; color: var(--soft); cursor: pointer; display: flex; align-items: center; gap: 7px; }
.nav button svg { width: 18px; height: 18px; }
.nav button:hover { color: var(--ink); }
.nav button.on { background: var(--ink); color: #fff; }
@media (max-width: 760px) {
  /* backdrop-filter crée un bloc conteneur : la barre « fixed » resterait collée à l'en-tête */
  .top { backdrop-filter: none; background: var(--bg); position: static; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: #fffdf9; border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; gap: 0; }
  .nav button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; border-radius: 10px; flex: 1; }
  .nav button svg { width: 22px; height: 22px; }
  .nav button.on { background: var(--gold-c); color: var(--ink); }
  .brand small { display: none; }
}

main { max-width: 1040px; margin: 0 auto; padding: 18px; }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.view-head p { margin: 2px 0 0; color: var(--soft); }

/* ---------- cartes ---------- */
.grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1.15fr .85fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--ombre); padding: 18px; min-width: 0; }
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); }
.muted { color: var(--soft); }
.small { font-size: 13px; }
.stack > * + * { margin-top: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.stat .v { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.stat .v small { font-size: 14px; color: var(--soft); font-family: var(--sans); }
.stat .l { font-size: 12px; color: var(--soft); }
.good { color: var(--green); } .bad { color: var(--rouge); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--gold-c); color: #7a5520; white-space: nowrap; }
.pill.green { background: var(--green-c); color: var(--green); }
.pill.grey { background: #efebe5; color: var(--soft); }

/* ---------- boutons + champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 15px; border-radius: 999px; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2d2823; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { color: var(--rouge); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--soft); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; background: #fdfcfa; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { background: #fff; border-color: var(--gold); }
textarea { min-height: 80px; resize: vertical; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

.seg { display: inline-flex; background: #ebe6de; border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- entraînement ---------- */
.walk { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--gold-c); border-radius: var(--r-sm); }
.walk .big { font-family: var(--serif); font-size: 34px; line-height: 1; }
.walk .big small { font-size: 14px; font-family: var(--sans); }
.ex { list-style: none; padding: 0; margin: 0; }
.ex li { padding: 10px 0; border-top: 1px solid var(--line); }
.ex li:first-child { border-top: 0; }
.ex .n { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.ex .n span:last-child { font-weight: normal; color: var(--gold); white-space: nowrap; }
.ex p { margin: 2px 0 0; font-size: 13px; color: var(--soft); }
.feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.feel button { border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 9px 4px; cursor: pointer; }
.feel button.on { border-color: var(--gold); background: var(--gold-c); }
.done-banner { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-sm); background: var(--green-c); color: var(--green); }
.level { display: flex; gap: 3px; }
.level i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.level i.on { background: var(--gold); }

/* ---------- souper ---------- */
.supper-title { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.portion { border-left: 3px solid var(--gold); padding: 8px 12px; background: #fbf8f3; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ing { list-style: none; padding: 0; margin: 0; columns: 2 220px; column-gap: 24px; }
.ing li { break-inside: avoid; padding: 4px 0; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ing .q { color: var(--soft); font-size: 13px; }
.steps { padding-left: 20px; margin: 0; }
.steps li { padding: 4px 0; }
.empty { text-align: center; padding: 24px 12px; color: var(--soft); }
.empty svg { width: 34px; height: 34px; color: var(--pale); margin-bottom: 6px; }

.portions { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 8px; }
.portions > div { padding: 8px 12px; background: #fbf8f3; border-radius: var(--r-sm); font-size: 14px; }
.stars { color: var(--line); letter-spacing: 1px; font-size: 14px; }
.stars i { font-style: normal; }
.stars i.on { color: var(--gold); }
.rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.star-btns { display: flex; }
.star-btns button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px 3px; }
.star-btns button.on { color: var(--gold); }
.star-btns:hover button { color: var(--gold); }
.star-btns button:hover ~ button { color: var(--line); }
.rec-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rec { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.rec:hover { border-color: var(--gold); }
.rec.rejected { opacity: .55; }
.rec .t { font-family: var(--serif); font-size: 17px; line-height: 1.25; }

.kcal-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.kcal-big { font-family: var(--serif); font-size: 40px; line-height: 1; }
.kcal-side { text-align: right; color: var(--soft); line-height: 1.6; }
.kcal-side strong { color: var(--ink); font-weight: 600; }
.bar { height: 10px; background: #efe9e0; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.bar i.over { background: var(--rouge); }
.food { list-style: none; margin: 10px 0 0; padding: 0; }
.food li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.food .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food .k { font-variant-numeric: tabular-nums; color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- séance ---------- */
.plan { margin: 0 0 12px; padding-left: 20px; }
.plan li { padding: 2px 0; }
.btn.big { padding: 13px 18px; font-size: 16px; }
.step-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 13px var(--sans); flex: none; }
.walk-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--gold-c); border-radius: var(--r-sm); padding: 12px; text-align: center; }
.walk-big .v { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.walk-big .l { font-size: 12px; color: var(--soft); }
.exc { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin-bottom: 10px; background: #fff; }
.exc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.exc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.reps { background: var(--gold); color: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 600; white-space: nowrap; font-size: 14px; }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: var(--r-sm); overflow: hidden; cursor: pointer; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.thumb .play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; background: rgba(24,21,18,.8); color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center; padding-left: 4px; }
.thumb .by { position: absolute; left: 8px; bottom: 8px; background: rgba(24,21,18,.75); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.how { margin: 10px 0 6px; padding-left: 22px; }
.how li { padding: 3px 0; }
.variants { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: #fbf8f3; border-radius: var(--r-sm); padding: 8px 10px; }
.timer { font-family: var(--serif); font-size: 64px; text-align: center; margin: 14px 0 8px; font-variant-numeric: tabular-nums; }
.guided-nav { justify-content: space-between; margin-top: 16px; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 4px; }

.win-rows { display: grid; gap: 6px; }
.win-row { display: grid; grid-template-columns: 110px 1fr auto 1fr; gap: 8px; align-items: center; }
.win-row input[type=time] { width: 100%; background: #fdfcfa; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px; }

.orig { display: block; width: 100%; font-size: 12px; color: var(--pale); }
.comps { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; color: var(--soft); }

/* ---------- calendrier ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--soft); text-align: center; padding-bottom: 2px; }
.day { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 104px; padding: 6px 7px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: border-color .15s; }
.day:hover { border-color: var(--gold); }
.day.out { background: transparent; border-style: dashed; opacity: .6; }
.day.today { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.day .d { font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.day .s { font-size: 12px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.day .w { font-size: 11px; color: var(--soft); display: flex; align-items: center; gap: 4px; margin-top: auto; }
.day .w.ok { color: var(--green); }
.day svg { width: 13px; height: 13px; flex: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: inline-block; }
@media (max-width: 760px) {
  .cal { gap: 3px; }
  .day { min-height: 62px; padding: 4px; }
  .day .s { -webkit-line-clamp: 2; font-size: 10.5px; }
  .day .d span { display: none; }
  .day .w span { display: none; }
}

/* ---------- épicerie / rabais ---------- */
.store { margin-bottom: 14px; }
.store h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gl { list-style: none; margin: 0; padding: 0; }
.gl li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.gl li:first-child { border-top: 0; }
.gl li.checked .t { text-decoration: line-through; color: var(--pale); }
.gl .t { flex: 1; min-width: 0; }
.gl .t small { display: block; color: var(--soft); }
.deals { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.deal { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.deal img { width: 100%; height: 100px; object-fit: contain; }
.deal .nm { font-size: 12.5px; line-height: 1.3; }
.deal .pr { font-family: var(--serif); font-size: 19px; color: var(--gold); }

/* ---------- tableaux ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; font-size: 12px; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.chart-box { position: relative; height: 300px; }
@media (max-width: 760px) { .chart-box { height: 240px; } }

/* ---------- modale + toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(24,21,18,.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal { background: var(--bg); border-radius: var(--r); width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { position: sticky; top: 0; background: var(--bg); padding: 16px 18px 10px; display: flex; justify-content: space-between; align-items: start; gap: 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.modal-body { padding: 16px 18px 20px; }
.x { border: 0; background: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; flex: none; border: 1px solid var(--line); }
@media (max-width: 760px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--r) var(--r) 0 0; max-height: 94vh; }
}
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px; z-index: 60; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--ombre); }
.toast.err { background: var(--rouge); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: min(400px, 100%); }
.login h1 { margin-bottom: 4px; }
.login h1 b { color: var(--gold); font-weight: normal; }
.err-msg { color: var(--rouge); font-size: 14px; min-height: 20px; }
