/* Mise en page : en-tête fixe à onglets, fil + colonne latérale, grilles de cartes. Palette reprise du site Life And Rituals. */
:root {
  --bg: #f1ebe2; --surface: #fbf8f3; --line: #e2d7c6; --ink: #3e2a33; --muted: #7d6a70;
  --accent: #744b5d; --accent-deep: #4f3140; --accent-soft: #eadde1; --on-accent: #f8f2ea;
  --gold: #a5853f; --ok: #3f6b4f; --ok-soft: #dfeadf; --danger: #a23b3b;
  --a0: #744b5d; --a1: #a5853f; --a2: #5b6e63; --a3: #8a5a44; --a4: #4f5a78;
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Assistant", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1d1619; --surface: #271e22; --line: #3a2e33; --ink: #efe6dc; --muted: #b3a2a6;
  --accent: #c99ab0; --accent-deep: #e2bfcf; --accent-soft: #3b2a32; --on-accent: #1d1619;
  --gold: #d4b26a; --ok: #8cc29f; --ok-soft: #22362a; --danger: #e48a8a; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #1d1619; --surface: #271e22; --line: #3a2e33; --ink: #efe6dc; --muted: #b3a2a6;
  --accent: #c99ab0; --accent-deep: #e2bfcf; --accent-soft: #3b2a32; --on-accent: #1d1619;
  --gold: #d4b26a; --ok: #8cc29f; --ok-soft: #22362a; --danger: #e48a8a; color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.5rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 720px; display: grid; gap: 16px; padding-block: 0 48px; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row.tight { gap: 6px; } .row.between { justify-content: space-between; flex-wrap: wrap; } .wrap-row { flex-wrap: wrap; }
.stack { display: grid; gap: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.eyebrow, .label { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 600; color: var(--gold); font-family: var(--body); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.empty { text-align: center; color: var(--muted); }
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; margin-block: 12px; }
.notice.error { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.pill { display: inline-block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; vertical-align: middle; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: 99px; padding: 9px 20px; text-decoration: none; cursor: pointer; font-weight: 600; font-size: .95rem; }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 6px 14px; font-size: .85rem; } .btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.act { background: none; border: 0; padding: 6px 10px; border-radius: 99px; color: var(--muted); cursor: pointer; font-size: .9rem; }
.act:hover { background: var(--accent-soft); color: var(--accent); }
.act.on { color: var(--accent); font-weight: 600; } .act.danger { color: var(--danger); font-weight: 600; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
select { width: auto; } textarea { resize: vertical; }
label { font-weight: 600; font-size: .9rem; } label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; }

.avatar { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-weight: 600; font-size: .9rem; letter-spacing: .02em; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; } .avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.t0 { background: var(--a0); } .avatar.t1 { background: var(--a1); } .avatar.t2 { background: var(--a2); } .avatar.t3 { background: var(--a3); } .avatar.t4 { background: var(--a4); }

.demo-bar { background: var(--accent-deep); color: var(--bg); font-size: .85rem; padding-block: 6px; }
.demo-bar .row { justify-content: space-between; flex-wrap: wrap; }
.demo-bar .link { color: var(--bg); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .row { min-height: 60px; flex-wrap: wrap; row-gap: 0; }
.brand { font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--accent); text-decoration: none; margin-right: 12px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs a { padding: 18px 12px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: .95rem; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.me { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: .9rem; }
main { padding-block: 24px 48px; }
.page-head { display: grid; gap: 4px; margin-bottom: 20px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: grid; gap: 14px; }
.login-card h1 { font-size: 2.8rem; color: var(--accent); }
.demo-pick { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; line-height: 1.3; }
.pick:hover { border-color: var(--accent); }

.feed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.feed { display: grid; gap: 14px; min-width: 0; }
.side { display: grid; gap: 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
.composer-open { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--muted); cursor: pointer; }
.composer { display: grid; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 14px; border-radius: 99px; cursor: pointer; font-size: .88rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.post { display: grid; gap: 10px; }
.post.pinned { border-color: var(--gold); }
.post header .who { display: grid; line-height: 1.3; flex: 1; min-width: 0; }
.post h3 { font-size: 1.45rem; }
.title-btn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.title-btn:hover { color: var(--accent); }
.post-body { overflow-wrap: anywhere; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post footer { border-top: 1px solid var(--line); padding-top: 6px; }
.comments { display: grid; gap: 12px; background: var(--bg); border-radius: 8px; padding: 12px; }
.comment { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.about { display: grid; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-block: 1px solid var(--line); padding-block: 10px; }
.stats strong { display: block; font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stats span { font-size: .78rem; color: var(--muted); }
.mini-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; line-height: 1.3; }
.mini-list li { display: flex; gap: 10px; align-items: center; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.course { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: border-color .15s; }
.course:hover { border-color: var(--accent); }
.course-info { padding: 16px 18px 18px; display: grid; gap: 8px; }
.cover { aspect-ratio: 16 / 8; max-width: 100%; display: grid; place-items: end start; padding: 16px; background-size: cover; background-position: center; color: #f8f2ea; }
.cover span { font-family: var(--display); font-size: 1.7rem; font-style: italic; line-height: 1.1; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.cover.h0 { background-color: #5e3a4b; background-image: radial-gradient(circle at 78% 30%, #c79a5a 0 14%, transparent 15%), radial-gradient(circle at 78% 30%, transparent 0 22%, rgba(241,235,226,.18) 22.5% 23%, transparent 23.5%), linear-gradient(160deg, #744b5d, #3c2531); }
.cover.h1 { background-color: #6e5a32; background-image: radial-gradient(circle at 80% 25%, rgba(248,242,234,.85) 0 9%, transparent 9.5%), linear-gradient(170deg, #a5853f, #5d4a26); }
.cover.h2 { background-color: #34444f; background-image: repeating-radial-gradient(circle at 85% 40%, rgba(248,242,234,.16) 0 2px, transparent 2px 18px), linear-gradient(160deg, #4f5a78, #2b3240); }
.progress { height: 6px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lock { color: var(--gold); font-weight: 600; }

.course-grid-2 { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.outline { display: grid; gap: 10px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); max-height: calc(100vh - 110px); overflow: auto; }
.outline .back { text-decoration: none; }
.module { display: grid; gap: 4px; margin-top: 8px; }
.module ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.module a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem; line-height: 1.3; }
.module a:hover { background: var(--accent-soft); }
.module a.on { background: var(--accent-soft); font-weight: 600; }
.module a.locked { color: var(--muted); }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .7rem; }
.tick.done { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.add-module { margin-top: 8px; }
.pane { min-width: 0; }
.lesson { padding: 0; overflow: hidden; }
.video { aspect-ratio: 16 / 9; max-width: 100%; background: #160f12; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video.placeholder { display: grid; place-content: center; gap: 4px; text-align: center; color: #d8c8cf; background: repeating-linear-gradient(135deg, #2a1e24 0 14px, #251a1f 14px 28px); padding: 16px; }
.lesson-body { padding: 22px 24px 26px; display: grid; gap: 14px; }
.prose { max-width: 65ch; }
.resources { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.lesson-actions { border-top: 1px solid var(--line); padding-top: 16px; }
.unlock { padding: 0; overflow: hidden; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member { display: flex; gap: 14px; align-items: flex-start; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .feed-grid, .course-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .side, .outline { position: static; max-height: none; }
  .me span { display: none; }
  h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.lesson-body > .btn, .lesson-body > p > .btn { justify-self: start; }
