@font-face { font-family: Oswald; src: url(/fonts/oswald.woff2) format("woff2"); font-weight: 200 700; font-display: swap; }
:root {
  --ink: #1a1a1a;
  --black: #0d0d0c;
  --cream: #f7f2e9;
  --sand: #dccaa6;
  --sand-soft: #efe6d4;
  --accent: #a8874c;
  --gold: #b8924a;
  --gold-dark: #C9A85A;
  --brown: #7a5c1e;
  --muted: #6b6b6b;
  --line: #ece6da;
  --field: #faf9f6;
  --field-line: #ddd6c6;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: #1f1f1f; font-family: 'Open Sans', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { width: 100%; min-width: 0; }
a { color: var(--brown); }
#root { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--cream); }

/* Logo · même proportions que les e-books (Oswald) */
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.logo .l1 { font-family: Oswald, sans-serif; font-weight: 500; white-space: nowrap; line-height: 1.15; color: var(--gold-dark); }
.logo .l2 { font-family: Oswald, sans-serif; font-weight: 700; white-space: nowrap; line-height: .95; color: #fff; }
.logo.light .l1 { color: var(--gold); }
.logo.light .l2 { color: #111; }

/* En-têtes */
.top { background: var(--black); border-bottom: 3px solid var(--gold-dark); padding: calc(18px + var(--safe-t)) 16px 14px; display: flex; align-items: center; justify-content: center; position: relative; min-height: 64px; border-radius: 0 0 24px 24px; z-index: 2; }
.top .back { position: absolute; left: 6px; top: calc(50% + var(--safe-t) / 2); transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.top .right { position: absolute; right: 16px; top: calc(50% + var(--safe-t) / 2); transform: translateY(-50%); }
.top .titles { text-align: center; min-width: 0; padding: 0 44px; }
.top .kicker { font-family: Oswald, sans-serif; font-size: 9px; letter-spacing: .24em; color: var(--gold-dark); text-transform: uppercase; }
.top h1 { margin: 2px 0 0; color: #fff; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: #1f1f1f; border: 2px solid var(--gold-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; text-decoration: none; }

.band { background: var(--sand); padding: 20px 20px 58px; }
.top + .band { margin-top: -24px; padding-top: 44px; }
.top + .demo-flag { margin-top: -24px; padding-top: 30px; }
.band h2 { margin: 0; font-family: Oswald, sans-serif; text-transform: uppercase; letter-spacing: .14em; font-size: 26px; font-weight: 500; color: var(--ink); }
.band .sub { font-size: 14px; color: #3d3a35; margin-top: 4px; }

.page { flex: 1; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.page.lift { margin-top: -40px; padding-top: 0; }

.card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--brown); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.big { font-size: 20px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats > div { text-align: center; min-width: 0; }
.stats > div + div { border-left: 1px solid #eee; }
.stats b { display: block; font-size: 20px; color: var(--brown); white-space: nowrap; }
.stats span { font-size: 11px; color: var(--muted); }

.btn { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 10px; background: var(--gold-dark); color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--field-line); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.gold { background: var(--gold-dark); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--brown); font-weight: 700; cursor: pointer; padding: 8px 0; text-decoration: none; font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: #fff; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: #1f1f1f; box-shadow: var(--shadow); min-height: 120px; min-width: 0; }
.tile .ic { width: 40px; height: 40px; border-radius: 20px; border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.tile b { font-size: 15px; }
.tile span { font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: #e0a43a; margin-left: 6px; vertical-align: middle; }

.list a, .list button.li { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 18px; font-size: 15px; color: #1f1f1f; text-decoration: none; border: 0; border-bottom: 1px solid #f0f0f0; background: none; width: 100%; text-align: left; cursor: pointer; }
.list > :last-child { border-bottom: 0; }
.chev { color: #9a9a9a; }

/* Barre du bas */
.tabs { position: sticky; bottom: 0; display: flex; border-top: 1px solid #e8e6e1; background: #fff; padding-bottom: var(--safe-b); z-index: 5; }
.tabs a { flex: 1; min-width: 0; min-height: 60px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; font-size: 10.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a.on { color: var(--brown); font-weight: 700; }

/* Pastilles de jours */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: 0 0 auto; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--field-line); background: #fff; font-size: 14px; cursor: pointer; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }

/* Tableau d'exercices */
.extable .head, .extable .ex { display: grid; grid-template-columns: minmax(0, 1fr) 30px 44px 38px 42px; gap: 4px; align-items: center; padding: 8px 16px; }
.extable .head { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--sand-soft); }
.extable .head span, .extable .ex > span:not(:first-child) { text-align: center; }
.extable .ex { padding: 12px 16px; border-top: 1px solid #f0eee9; text-decoration: none; color: #1f1f1f; font-size: 14px; }
.extable .ex .nm { font-weight: 700; overflow-wrap: anywhere; }
.extable .ex .code { color: var(--brown); }
.extable .ex .vid { font-size: 11px; color: var(--brown); font-weight: 700; }
.extable .ex.done { background: #fbf8f1; }
.extable .ex.done .nm::after { content: ' ✓'; color: var(--accent); }

/* Vidéo */
.video { background: #1a1a1a; border-radius: var(--radius); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px 16px; text-align: center; font-size: 14px; text-decoration: none; }
.video .play { width: 60px; height: 60px; border-radius: 30px; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }

.params { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.params > div { text-align: center; min-width: 0; }
.params > div + div { border-left: 1px solid #eee; }
.params span { display: block; font-size: 11px; color: var(--muted); }
.params b { font-size: 20px; white-space: nowrap; }

.setrow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #f0eee9; }
.setrow .n { width: 22px; font-size: 15px; font-weight: 700; color: var(--muted); flex: 0 0 22px; }
.field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.field input, .input { height: 42px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--field); padding: 0 10px; font-size: 16px; color: #1f1f1f; }
.input.tall { height: 48px; border-radius: 12px; padding: 0 14px; }
textarea.input { height: auto; padding: 10px 12px; }
.check { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 22px; border: 1.5px solid var(--field-line); background: #fff; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.check.on { background: var(--ink); color: #fff; border-color: var(--accent); }

.rest { position: sticky; bottom: calc(68px + var(--safe-b)); background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.rest b { font-family: Oswald, sans-serif; font-size: 26px; color: var(--sand); }

.supp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid #f0eee9; }
.supp .t { flex: 1; min-width: 0; }
.supp .t b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.supp .shop { font-size: 12px; font-weight: 700; text-decoration: none; text-align: center; min-height: 44px; min-width: 70px; display: flex; flex-direction: column; justify-content: center; border-radius: 10px; background: var(--sand-soft); color: var(--brown); padding: 0 8px; }
.section-h { background: var(--sand-soft); padding: 10px 14px; font-family: Oswald, sans-serif; letter-spacing: .1em; font-size: 14px; text-transform: uppercase; }
.progress { height: 6px; border-radius: 3px; background: #eee6d6; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); }

/* Connexion */
.login { flex: 1; display: flex; flex-direction: column; background: var(--cream); color: #fff; }
.login .hero { background: var(--black); border-radius: 0 0 28px 28px; padding: calc(40px + var(--safe-t)) 24px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; border-bottom: 3px solid var(--gold-dark); }
.login .hero p { margin: 0; color: #d8d2c6; font-size: 13px; }
.login form { background: var(--cream); color: #1f1f1f; flex: 1; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.err { background: #fbeaea; color: #8a1f1f; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.ok { background: #eef5e8; color: #2f5a1a; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal .sheet { background: var(--cream); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.stars { display: flex; gap: 8px; }
.stars button { flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid var(--field-line); background: #fff; font-weight: 700; cursor: pointer; }
.stars button.on { background: var(--ink); color: #fff; }

.demo-flag { background: var(--sand-soft); color: var(--brown); font-size: 12px; text-align: center; padding: 6px; }
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); }

.login .sent { background: var(--cream); color: #1f1f1f; flex: 1; padding: 32px 20px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.login .sent-ic { width: 56px; height: 56px; border-radius: 28px; border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center; }

/* iOS · les champs date ne débordent plus de la carte */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; max-width: 100%; min-width: 0; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.tabs a { flex: 1 1 0; }

/* Aucun glissement horizontal de la page */
html, body { overflow-x: hidden; overscroll-behavior-x: none; max-width: 100%; }
#root { overflow-x: clip; }
body { touch-action: pan-y pinch-zoom; }
