:root {
  /* Thème « verre dépoli » (maquette Figma) : papier chaud, encre brune, or */
  --bg: #f5f0e8;
  --bg-grad: linear-gradient(135deg, #ede8df 0%, #f5f0e8 50%, #e5ddd2 100%);
  --panel: rgba(250, 248, 244, 0.72);
  --panel-solid: #faf8f4;
  --panel2: #f0ebe3;
  --ink: #2c2416;
  --muted: #857a6c;
  --line: #e8e2d9;
  --gold: #c9a96e;
  --accent: #946f30;
  --accent-soft: rgba(201, 169, 110, 0.16);
  --accent-ink: #faf8f4;
  --primary: #2c2416;
  --primary-ink: #faf8f4;
  --sage: #7baf8a;
  --rose: #b5858b;
  --blue: #8b9dc3;
  --quote: rgba(201, 169, 110, 0.1);
  --code: #f0ebe3;
  --danger: #b0413e;
  --ok: #4f8a5f;
  --warn: #a8691c;
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(18px) saturate(150%);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(44, 36, 22, 0.05), 0 12px 32px rgba(44, 36, 22, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120d;
    --bg-grad: linear-gradient(135deg, #14110c 0%, #1c1712 50%, #120f0b 100%);
    --panel: rgba(40, 33, 25, 0.62);
    --panel-solid: #221c15;
    --panel2: #2a231a;
    --ink: #f3ede3;
    --muted: #a89b8a;
    --line: #3a3226;
    --accent: #d9bc85;
    --accent-soft: rgba(201, 169, 110, 0.16);
    --accent-ink: #2c2416;
    --primary: #f0e6d6;
    --primary-ink: #2c2416;
    --quote: rgba(201, 169, 110, 0.1);
    --code: #2a231a;
    --danger: #f08a80;
    --ok: #8fca9e;
    --warn: #f0b860;
    --glass-border: rgba(255, 240, 220, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 var(--font-body);
  background: var(--bg-grad) fixed, var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: var(--code); padding: 0.1em 0.35em; border-radius: 5px; font-size: 0.9em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.accent { color: var(--accent); }
.error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Inputs & buttons */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); font-weight: 400; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; min-height: 110px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--ink);
}
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.danger { color: var(--danger); }
.small { padding: 6px 10px; font-size: 13px; }
.icon-btn { padding: 6px 8px; background: none; border-color: transparent; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-box {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 28px;
}
.auth-brand { font-size: 30px; font-weight: 800; text-align: center; letter-spacing: -0.02em; }
.tabs { display: flex; background: var(--panel2); border-radius: 12px; padding: 4px; margin: 18px 0; }
.tab { flex: 1; border: 0; background: none; color: var(--muted); }
.tab.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.auth-step { margin-top: 18px; }
.auth-step h2 { margin: 0; font-size: 20px; }
.auth-step p { margin: 0; }
.link-btn {
  align-self: center; padding: 4px; border: 0; background: none; color: var(--muted);
  font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-btn:hover { color: var(--ink); }

/* Shell */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo { font-size: 24px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.user-chip.active { border-color: var(--accent); }
#userInitial { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 13px; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; justify-content: space-between; gap: 0; }
  .nav a { padding: 6px 5px; font-size: 13px; }
  .brand { flex: 1; }
  #userName { display: none; }
  .user-chip { padding: 4px; }
}
.banner {
  max-width: 1200px; margin: 12px auto 0; padding: 12px 16px; border-radius: 10px;
  background: #fff4e5; color: #7a4a00; border: 1px solid #f5d7a8;
}
@media (prefers-color-scheme: dark) { .banner { background: #3a2a10; color: #ffd79a; border-color: #5c4318; } }
@media (max-width: 1240px) { .banner { margin: 12px 16px 0; } }
.view { max-width: 1200px; margin: 0 auto; padding: 24px 24px 80px; }
.credit-notice {
  display: flex; gap: 12px; align-items: flex-start; margin: 12px 0 16px; padding: 14px 16px;
  border-radius: 14px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, var(--panel)); font-size: 14px; line-height: 1.5;
}
.credit-notice[hidden] { display: none; }
.credit-notice.empty {
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}
.cn-icon { font-size: 20px; line-height: 1.2; }
.cn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 760px) { .view { padding: 18px 16px 60px; } }
.view h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
.view > .sub, .page-head .sub { color: var(--muted); margin: 0 0 20px; }
.page-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; text-decoration: none; }

/* Home */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.hot { background: var(--accent-soft); border-color: var(--accent); }
.stat.hot b { color: var(--accent); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
@media (max-width: 760px) { .quick { grid-template-columns: 1fr; } }
.quick a { display: block; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.quick a:hover { border-color: var(--accent); }
.quick a b { display: block; font-size: 16px; margin: 6px 0 2px; }
.quick a small { color: var(--muted); }
.quick .qi { font-size: 26px; }
h2.section { font-size: 17px; margin: 26px 0 12px; }

/* Lists of items */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.item {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.item:hover { border-color: var(--accent); }
.item h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.item small { color: var(--muted); font-size: 12.5px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag.plain { background: var(--panel2); color: var(--muted); }
.tag.due { background: #fde8e8; color: #b42318; }
@media (prefers-color-scheme: dark) { .tag.due { background: #4a1f1f; color: #ffb4ab; } }
.empty-state { text-align: center; color: var(--muted); padding: 40px 16px; border: 2px dashed var(--line); border-radius: var(--radius); }
.empty-state .big { font-size: 38px; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input { flex: 3; min-width: 200px; }
.filters select { flex: 1; min-width: 140px; }
.bar { height: 6px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.bar > div { height: 100%; background: var(--ok); border-radius: 99px; }

/* Create */
.create { display: grid; grid-template-columns: minmax(330px, 420px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .create { grid-template-columns: 1fr; } }
.create form { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) { .create form { position: static; } }
.create form h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; text-align: center;
  border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; color: var(--ink); font-weight: 400;
}
.drop:hover, .drop.over, .drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop .drop-icon { font-size: 22px; }
.drop span, .drop small { color: var(--muted); }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel2); border-radius: 9px; font-size: 13.5px; }
.file-list .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .fsize { color: var(--muted); font-size: 12px; }
.file-list button { padding: 2px 6px; border: 0; background: none; color: var(--muted); }
details.paste summary { cursor: pointer; font-size: 14px; color: var(--accent); margin-top: 10px; font-weight: 600; }
details.paste textarea { margin-top: 8px; }
.modes { display: flex; flex-direction: column; gap: 8px; }
.mode { flex-direction: row; cursor: pointer; }
.mode input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.mode-card { display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; padding: 11px 12px; border: 2px solid var(--line); border-radius: 12px; width: 100%; color: var(--ink); }
.mode-card .mi { grid-row: span 2; font-size: 22px; align-self: center; }
.mode-card strong { font-size: 14px; }
.mode-card small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.mode input:checked + .mode-card { border-color: var(--accent); background: var(--accent-soft); }
.mode input:focus-visible + .mode-card { outline: 2px solid var(--accent); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.source-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.source-chip span { flex: 1; }
.output { min-height: 60vh; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.status { color: var(--muted); font-size: 14px; }
.status.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -1px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }
.placeholder { text-align: center; color: var(--muted); padding: 60px 20px; }
.placeholder .big { font-size: 44px; }

/* Rendered course */
.sheet { line-height: 1.65; font-size: 15.5px; overflow-wrap: break-word; }
.sheet h1 { font-size: 26px; border-bottom: 3px solid var(--accent); padding-bottom: 8px; margin: 0 0 16px; letter-spacing: -0.01em; }
.sheet h2 { font-size: 20px; color: var(--accent); margin: 28px 0 10px; }
.sheet h3 { font-size: 17px; margin: 20px 0 8px; }
.sheet h4 { font-size: 15.5px; margin: 16px 0 6px; }
.sheet blockquote { margin: 12px 0; padding: 10px 16px; background: var(--quote); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; }
.sheet blockquote p { margin: 4px 0; }
.sheet table { border-collapse: collapse; margin: 12px 0; display: block; overflow-x: auto; max-width: 100%; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; }
.sheet th { background: var(--panel2); }
.sheet pre { background: var(--code); padding: 12px; border-radius: 10px; overflow-x: auto; }
.sheet details { margin: 6px 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.sheet summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.sheet .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.sheet .cursor::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor textarea { min-height: 70vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.55; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .editor textarea { min-height: 50vh; } }
.doc-head input.title-input { font-size: 22px; font-weight: 800; padding: 6px 10px; background: transparent; border-color: transparent; }
.doc-head input.title-input:hover, .doc-head input.title-input:focus { border-color: var(--line); background: var(--panel2); }
.meta-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; color: var(--muted); font-size: 13.5px; }
.meta-row input { width: auto; max-width: 220px; padding: 5px 10px; font-size: 13.5px; }

/* Deck editor */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.card-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: start; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card-row .cq { font-weight: 600; }
.card-row .ca { color: var(--muted); }
.card-row .cq p, .card-row .ca p { margin: 0; }
.card-row .actions { display: flex; gap: 2px; align-items: center; }
.card-row textarea { min-height: 70px; }
.card-row.editing { grid-template-columns: 1fr 1fr; }
.card-row.editing .actions { grid-column: 1 / -1; justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) { .card-row, .card-row.editing { grid-template-columns: 1fr; } }
.box-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.box-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.box-dots i.on { background: var(--ok); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* Study */
.study { max-width: 680px; margin: 0 auto; }
.progress { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin: 10px 0 18px; }
.progress > div { height: 100%; background: var(--accent); transition: width 0.3s; }
.flip { perspective: 1400px; height: min(52vh, 380px); cursor: pointer; border: 0; padding: 0; background: none; width: 100%; display: block; }
.flip:hover { border: 0; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform 0.5s; transform-style: preserve-3d; }
.flip.on .flip-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px 28px;
  text-align: center; font-size: 20px; font-weight: 500; overflow: auto;
}
.face p { margin: 4px 0; }
.face.back { transform: rotateY(180deg); background: var(--accent-soft); }
.face .label { position: absolute; top: 14px; left: 18px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
@media (max-width: 560px) { .grades { grid-template-columns: repeat(2, 1fr); } }
.grades button { flex-direction: column; gap: 0; padding: 10px 6px; }
.grades button small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.g-again { border-color: var(--danger) !important; color: var(--danger); }
.g-hard { border-color: var(--warn) !important; color: var(--warn); }
.g-good { border-color: var(--ok) !important; color: var(--ok); }
.g-easy { border-color: var(--accent) !important; color: var(--accent); }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; }
.done-box { text-align: center; padding: 40px 20px; }
.done-box .big { font-size: 54px; }

/* Account */
.account { max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* Print: only the course */
@media print {
  .topbar, .banner, .toolbar, .noprint, .create form, .back, .meta-row, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .view { padding: 0; max-width: none; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  .create { display: block; }
  .sheet h2 { color: #312e81; }
  .sheet blockquote { background: #f4f6ff; }
}

/* Multi-format generation */
.modes-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.modes-head h2 { margin: 0 !important; }
.modes-hint { font-size: 12.5px; margin: 8px 0 0; }
.mode-card { position: relative; padding-right: 38px; }
.mode-card .check {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  border: 2px solid var(--line); border-radius: 6px; background: var(--panel);
}
.mode input:checked + .mode-card .check { background: var(--accent); border-color: var(--accent); }
.mode input:checked + .mode-card .check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.part-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.part-tab { border-radius: 999px; padding: 7px 12px; font-size: 13.5px; color: var(--muted); }
.part-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.part-tab .badge { display: inline-flex; min-width: 14px; justify-content: center; font-size: 12px; }
.part-tab.ok .badge { color: var(--ok); }
.part-tab.error .badge { color: var(--danger); }
.dot.busy { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.quick a.all { background: var(--accent-soft); border-color: var(--accent); }

/* Credits & plans */
.credit-chip { text-decoration: none; font-weight: 700; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.credit-chip.active { outline: 2px solid var(--accent); }
.credit-chip.empty { background: #fde8e8; color: #b42318; }
@media (prefers-color-scheme: dark) { .credit-chip.empty { background: #4a1f1f; color: #ffb4ab; } }
a.stat { text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--accent); }
.stat.warn { border-color: var(--danger); }
.stat.warn b { color: var(--danger); }
.go { display: flex; flex-direction: column; gap: 8px; }
.cost-info { margin: 0; font-size: 13px; color: var(--muted); text-align: center; min-height: 1.2em; }
.cost-info.error { color: var(--danger); }
.my-credits { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.my-credits .big-line { font-size: 22px; font-weight: 800; }
.credit-meter { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.bar.thick { height: 10px; }
.bar.thick > div { background: var(--accent); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 16px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan.current { background: var(--accent-soft); }
.plan .ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.plan .plan-icon { font-size: 26px; }
.plan h3 { margin: 0; font-size: 17px; }
.plan .price { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.plan .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 4px 0 10px; flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.plan li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.pack { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table select { width: auto; padding: 6px 8px; }
@media (max-width: 760px) { .credit-chip { padding: 5px 9px; font-size: 12.5px; } }

/* Paywall */
.paywall { display: flex; flex-direction: column; gap: 20px; }
.pw-head { text-align: center; }
.pw-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.pw-head .sub { margin: 0 auto; max-width: 560px; }
.pw-benefits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.pw-benefits li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--panel2); border-radius: 12px; }
.pw-benefits b { display: block; font-size: 14.5px; }
.pw-benefits small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pw-b-icon { font-size: 22px; line-height: 1.2; }
.pw-plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: stretch; padding-top: 12px; }
.pw-plan { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.pw-plan:hover { border-color: var(--accent); }
.pw-plan input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.pw-plan:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pw-plan.recommended { border: 2px solid var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--panel) 55%); transform: translateY(-10px); box-shadow: var(--shadow); }
.pw-plan.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.pw-plan.selected::after { content: "✓"; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.pw-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.pw-badge.muted-badge { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.pw-name { font-weight: 800; font-size: 16px; }
.pw-tag { color: var(--muted); font-size: 12.5px; min-height: 2.6em; line-height: 1.3; }
.pw-price { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.pw-price small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pw-unit { font-size: 12px; color: var(--ok); font-weight: 600; }
.pw-plan ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.pw-plan li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.pw-footer { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pw-cta { width: 100%; max-width: 420px; padding: 14px 20px; font-size: 16px; font-weight: 800; border-radius: 12px; }
.pw-fine { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; max-width: 520px; }
@media (max-width: 980px) {
  .pw-plans { grid-template-columns: 1fr; gap: 14px; }
  .pw-plan.recommended { order: -1; transform: none; }
  .pw-tag { min-height: 0; }
}

.pw-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 28px 24px 20px; border: 0; border-radius: 20px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.pw-dialog::backdrop { background: rgba(15, 16, 25, 0.55); backdrop-filter: blur(3px); }
.pw-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.pw-skip { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--muted); font-size: 13.5px; text-decoration: underline; }
.pw-skip:hover { color: var(--ink); }
@media (max-width: 760px) {
  .pw-dialog { padding: 24px 16px 16px; }
  .pw-head h1 { font-size: 22px; padding: 0 28px; }
}

/* Library folders */
.folders { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.folder-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.folder-chip { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.folder-chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.folder-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.folder-chip.active span { color: var(--accent); }
.folder-chip.add { border-style: dashed; color: var(--muted); }
.folder-chip.add:hover { color: var(--accent); }
.folder-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.folder-actions b { margin-right: 4px; }
.meta-row select { width: auto; max-width: 220px; padding: 5px 10px; font-size: 13.5px; }

/* Modal form */
.modal { width: min(440px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.modal::backdrop { background: rgba(15, 16, 25, 0.5); backdrop-filter: blur(2px); }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0 0 4px; font-size: 19px; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; }
.modal .form-error { margin: 0; color: var(--danger); font-size: 13px; }
.modal .form-error:empty { display: none; }
.modal-actions { justify-content: flex-end; margin-top: 4px; }

/* ======================================================================
   Thème « carte en verre dépoli » (maquette Figma) — ordinateur et mobile
   ====================================================================== */

/* Halos colorés derrière le verre */
body::before {
  content: ""; position: fixed; inset: -10vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 8%, rgba(201, 169, 110, 0.28), transparent 70%),
    radial-gradient(34vmax 34vmax at 92% 22%, rgba(123, 175, 138, 0.2), transparent 70%),
    radial-gradient(40vmax 40vmax at 70% 96%, rgba(181, 133, 139, 0.2), transparent 70%),
    radial-gradient(30vmax 30vmax at 4% 80%, rgba(139, 157, 195, 0.16), transparent 70%);
}
@media (prefers-color-scheme: dark) { body::before { opacity: 0.55; } }

/* Verre dépoli */
.panel, .item, .stat, .quick a, .auth-box, .plan, .pw-plan, .card-row, .face, .empty-state, .table-wrap, .user-chip {
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.empty-state { border: 2px dashed var(--line); box-shadow: none; }
.item, .quick a, .stat { transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.item:hover, .quick a:hover, a.stat:hover { transform: translateY(-2px); border-color: rgba(201, 169, 110, 0.55); box-shadow: 0 2px 4px rgba(44, 36, 22, 0.05), 0 18px 40px rgba(44, 36, 22, 0.12); }
.face { background: var(--panel-solid); }
.face.back { background: color-mix(in srgb, var(--gold) 12%, var(--panel-solid)); }
.pw-dialog, .modal { background: color-mix(in srgb, var(--panel-solid) 88%, transparent); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); }
.pw-dialog::backdrop, .modal::backdrop { background: rgba(44, 36, 22, 0.35); }

/* Typographie : Fraunces fine pour les titres, un mot en or */
.view h1, .pw-head h1, h2.section, .sheet h1, .sheet h2, .modal h2, .done-box h2 {
  font-family: var(--font-display); font-weight: 300; letter-spacing: -0.01em;
}
.view h1 { font-size: 34px; line-height: 1.15; }
.view h1 em, .pw-head h1 em { color: var(--gold); font-style: italic; }
h2.section { font-size: 22px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 500; }
.panel h2, .create form h2 { font-weight: 500; }
label { font-weight: 500; }
button, .btn { font-weight: 500; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 32px; }
.stat.hot { background: color-mix(in srgb, var(--gold) 14%, var(--panel)); border-color: rgba(201, 169, 110, 0.6); }
.stat.hot b { color: var(--accent); }
.plan .price, .pw-price { font-family: var(--font-display); font-weight: 400; }
.sheet h1 { font-size: 30px; border-bottom: 2px solid var(--gold); }
.sheet h2 { font-size: 23px; color: var(--accent); }
.sheet blockquote { border-left-color: var(--gold); }
.doc-head input.title-input { font-family: var(--font-display); font-weight: 400; font-size: 26px; }

/* Logo façon « mémo. » */
.brand, .auth-brand { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.02em; color: var(--ink); }
.brand { font-size: 24px; gap: 0; display: inline-block; }
.auth-brand { font-size: 42px; line-height: 1.1; }
.brand em, .auth-brand em { color: var(--gold); font-style: italic; }

/* Boutons « pilule » */
button, .btn { border-radius: 99px; padding: 9px 16px; background: var(--panel-solid); }
.small { padding: 6px 12px; }
.btn.primary, button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px rgba(44, 36, 22, 0.18); }
.btn.primary:hover:not(:disabled), button.primary:hover:not(:disabled) { filter: none; border-color: var(--primary); background: color-mix(in srgb, var(--primary) 86%, var(--gold)); }
.icon-btn { background: none; }
input, select, textarea { border-radius: 12px; background: color-mix(in srgb, var(--panel2) 85%, transparent); }
input:focus, select:focus, textarea:focus { outline-color: var(--gold); }
.tabs { background: color-mix(in srgb, var(--panel2) 80%, transparent); border-radius: 99px; }
.tab { border-radius: 99px; }
.tab.active { background: var(--panel-solid); }
.step { background: var(--primary); color: var(--gold); }
#userInitial { background: var(--primary); color: var(--gold); }
.credit-chip { background: var(--primary); color: var(--gold); }
.credit-chip.empty { background: #f6dcd9; color: #9c2f2a; }
@media (prefers-color-scheme: dark) { .credit-chip.empty { background: #4a211d; color: #ffb4ab; } }

/* Barre du haut en verre */
/* Le flou est sur un pseudo-élément : un backdrop-filter sur .topbar deviendrait le repère
   des éléments « fixed » qu'il contient, et la barre de navigation mobile ne descendrait plus en bas. */
.topbar { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--glass-border); }
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--panel-solid) 62%, transparent);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.nav a { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; font-weight: 500; }
.nav a .ni { font-size: 14px; }
.nav a.active { background: var(--primary); color: var(--primary-ink); }
.nav a.active .ni { color: var(--gold); }

/* Carte sombre « Tout en une fois » (comme « Nouveau cours » sur la maquette) */
.quick a.all { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.quick a.all b { color: var(--gold); }
.quick a.all small { color: color-mix(in srgb, var(--primary-ink) 75%, transparent); }

/* Formats : or / sauge / rose comme la maquette */
.mode-card { border-radius: 14px; background: color-mix(in srgb, var(--panel2) 70%, transparent); border-width: 1.5px; }
.mode-card.m-propre { --mc: var(--gold); }
.mode-card.m-flashcards { --mc: var(--sage); }
.mode-card.m-fiche { --mc: var(--rose); }
.mode-card { border-color: color-mix(in srgb, var(--mc, var(--gold)) 30%, transparent); }
.mode input:checked + .mode-card { border-color: var(--mc, var(--gold)); background: color-mix(in srgb, var(--mc, var(--gold)) 14%, var(--panel)); }
.mode input:checked + .mode-card .check { background: var(--mc, var(--gold)); border-color: var(--mc, var(--gold)); border-radius: 50%; }
.mode input:checked + .mode-card .check::after { border-color: #fff; }
.mode-card .check { border-radius: 50%; }
.drop { border-radius: 14px; background: color-mix(in srgb, var(--panel2) 70%, transparent); }
.drop:hover, .drop.over, .drop:focus-visible { border-color: var(--gold); background: var(--accent-soft); }

/* Tags et puces */
.tag { font-weight: 500; }
.folder-chip.active, .part-tab.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.folder-chip.active span { color: var(--gold); }
.bar > div, .box-dots i.on { background: var(--sage); }
.bar.thick > div, .progress > div { background: var(--gold); }
.toast { border-radius: 99px; background: var(--primary); color: var(--primary-ink); }

/* Paywall aux couleurs du thème */
.pw-plan.recommended { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 18%, var(--panel)), var(--panel) 60%); border-color: var(--gold); }
.pw-plan.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.35); }
.pw-plan.selected::after, .pw-badge, .plan .ribbon { background: var(--primary); color: var(--gold); }
.pw-cta { border-radius: 99px; }

/* ---------- Mobile : barre de navigation en verre en bas ---------- */
@media (max-width: 760px) {
  .topbar { flex-wrap: nowrap; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand { font-size: 22px; }
  .nav {
    position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    order: initial; flex-basis: auto; display: flex; justify-content: space-around; gap: 0; overflow: visible;
    padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--panel-solid) 70%, transparent);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); box-shadow: 0 12px 36px rgba(44, 36, 22, 0.18);
  }
  .nav a { flex: 1; flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 10.5px; border-radius: 16px; color: var(--ink); opacity: 0.55; min-width: 0; }
  .nav a span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav a .ni { font-size: 18px; line-height: 1.2; }
  .nav a.active { opacity: 1; background: var(--primary); color: var(--primary-ink); }
  .view { padding-bottom: 120px; }
  .view h1 { font-size: 28px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Barre latérale (ordinateur), d'après la maquette ---------- */
.sidebar { display: none; }
@media (min-width: 1100px) {
  .shell-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto;
    display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px;
    border-right: 1px solid var(--glass-border);
    background: color-mix(in srgb, var(--panel-solid) 45%, transparent);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  }
  .shell-body .view { width: 100%; }
}
.sb-title { margin: 0 0 8px; padding: 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; }
.sb-source {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; margin-bottom: 5px; border-radius: 10px;
  background: color-mix(in srgb, var(--panel2) 80%, transparent); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: border-color 0.2s, transform 0.2s;
}
.sb-source:hover { border-color: var(--gold); transform: translateX(2px); }
.sb-icon { font-size: 16px; flex: none; }
.sb-text { min-width: 0; display: flex; flex-direction: column; }
.sb-text b { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-empty { margin: 0 0 6px; padding: 0 6px; font-size: 12.5px; color: var(--muted); }
.sb-add {
  display: block; margin-top: 4px; padding: 8px; border-radius: 10px; border: 1px dashed var(--line);
  text-align: center; font-size: 12px; color: var(--muted); text-decoration: none;
}
.sb-add:hover { border-color: var(--gold); color: var(--accent); }
.sb-gen {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; margin-bottom: 3px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.sb-gen:hover { background: color-mix(in srgb, var(--panel2) 80%, transparent); color: var(--ink); }
.sb-gen.active { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sb-label { flex: 1; }
.sb-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-goal {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 11px; border-radius: 12px;
  background: var(--primary); color: var(--primary-ink); text-decoration: none;
}
.sb-goal .ring { transform: rotate(-90deg); flex: none; }
.sb-goal b { display: block; font-size: 12.5px; font-weight: 500; }
.sb-goal small { font-size: 11.5px; color: var(--gold); }
@media print { .sidebar { display: none !important; } .shell-body { display: block !important; } }

/* ---------- Nouveaux formats : QCM et podcast ---------- */
.mode-card.m-qcm { --mc: var(--blue); }
.mode-card.m-podcast { --mc: #a98bc4; }
.print-only { display: none; }
@media print { .print-only { display: block !important; } }

/* QCM interactif */
.qcm { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.qcm-head { display: flex; justify-content: space-between; align-items: center; }
.qcm-head .eyebrow { margin: 0; }
.qcm-score { font-size: 13px; color: var(--ok); font-weight: 600; }
.qcm .progress { margin: 0; }
.qcm-question { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.35; }
.qcm-question p { margin: 0 0 6px; }
.qcm-choices { display: flex; flex-direction: column; gap: 8px; }
.qcm-choice {
  justify-content: flex-start; text-align: left; gap: 12px; padding: 12px 16px; border-radius: 14px; width: 100%;
  background: var(--panel); border: 1.5px solid var(--line); font-weight: 400; font-size: 15px; line-height: 1.4;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.qcm-choice:hover:not(:disabled) { border-color: var(--gold); transform: translateX(3px); }
.qcm-choice:disabled { opacity: 1; cursor: default; }
.qcm-letter { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel2); font-weight: 600; font-size: 13px; }
.qcm-choice.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--panel)); }
.qcm-choice.right .qcm-letter { background: var(--ok); color: #fff; }
.qcm-choice.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--panel)); }
.qcm-choice.wrong .qcm-letter { background: var(--danger); color: #fff; }
.qcm-choice.dim { opacity: 0.55; }
.qcm-feedback { padding: 12px 16px; border-radius: 14px; border-left: 4px solid; background: var(--quote); }
.qcm-feedback.right { border-color: var(--ok); }
.qcm-feedback.wrong { border-color: var(--danger); }
.qcm-feedback p { margin: 6px 0 0; }
.qcm-next { align-self: flex-end; }
.qcm-end { text-align: center; align-items: center; padding: 10px 0; }
.qcm-big { font-family: var(--font-display); font-weight: 300; font-size: 64px; line-height: 1; }
.qcm-mood { margin: 0; font-size: 17px; }
.qcm-review-title { font-family: var(--font-display); font-weight: 400; margin: 18px 0 0; align-self: flex-start; }
.qcm-review { text-align: left; align-self: stretch; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.qcm-review small { color: var(--muted); }

/* Lecteur de podcast */
.pod { display: flex; flex-direction: column; gap: 12px; }
.pod-bar {
  position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px;
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow);
}
.pod-cover { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: color-mix(in srgb, var(--gold) 30%, transparent); flex: none; }
.pod-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pod-info b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-info small { color: var(--gold); font-size: 12px; }
.pod-controls { display: flex; align-items: center; gap: 4px; }
.pod-controls .icon-btn { color: var(--primary-ink); font-size: 16px; }
.pod-controls select { width: auto; padding: 6px 8px; border-radius: 99px; font-size: 13px; background: color-mix(in srgb, var(--primary-ink) 12%, transparent); color: var(--primary-ink); border-color: transparent; }
.pod-play.primary, button.pod-play.primary { width: 46px; height: 46px; padding: 0; border-radius: 50%; background: var(--gold); border-color: var(--gold); color: var(--primary); font-size: 18px; box-shadow: none; }
.pod-progress { margin: 0; }
.pod-voices summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.pod-voice-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.pod-voice-list label { flex: 1; min-width: 180px; }
.pod-script { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pod-line { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: background 0.15s; line-height: 1.55; }
.pod-line:hover { background: color-mix(in srgb, var(--panel2) 70%, transparent); }
.pod-who { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 3px; }
.pod-line.s0 .pod-who { color: var(--accent); }
.pod-line.s1 .pod-who { color: color-mix(in srgb, var(--sage) 80%, var(--ink)); }
.pod-line.active { background: var(--panel); border-color: var(--gold); box-shadow: var(--shadow); }
@media (max-width: 760px) {
  .pod-bar { top: 64px; flex-wrap: wrap; }
  .pod-controls { width: 100%; justify-content: center; }
  .pod-line { grid-template-columns: 1fr; gap: 2px; }
  .qcm-question { font-size: 19px; }
}

/* ---------- Mode Focus ---------- */
.focus-pill {
  text-decoration: none; font-weight: 600; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--gold); color: #2c2416; font-variant-numeric: tabular-nums; animation: focusPulse 2.4s ease-in-out infinite;
}
@keyframes focusPulse { 50% { box-shadow: 0 0 0 6px rgba(201, 169, 110, 0.25); } }
@media (prefers-reduced-motion: reduce) { .focus-pill { animation: none; } }
.focus-stats { margin-top: 4px; }
.focus-setup { display: flex; flex-direction: column; gap: 20px; }
.focus-setup section h2 { margin: 0 0 10px; }
.focus-durations { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.focus-durations .folder-chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.focus-custom { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); }
.focus-custom input { width: 88px; padding: 7px 12px; border-radius: 99px; }
.focus-apps { display: flex; flex-wrap: wrap; gap: 8px; }
.focus-app {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; font-size: 14px; font-weight: 500;
  border: 1.5px solid var(--line); background: var(--panel-solid); color: var(--muted); cursor: pointer;
}
.focus-app.on { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 14%, var(--panel-solid)); color: var(--ink); }
.focus-app.locked { cursor: default; }
.focus-add { margin-top: 10px; flex-wrap: nowrap; }
.focus-add input { flex: 1; min-width: 0; }
.focus-start { align-self: flex-start; padding: 13px 26px; font-size: 16px; }
.focus-guide { margin-top: 16px; }
.focus-guide summary { cursor: pointer; font-weight: 500; }
.focus-guide h3 { margin: 6px 0 6px; font-size: 15px; }
.focus-guide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.focus-session { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 8px; }
.focus-ring { position: relative; width: 240px; height: 240px; }
.focus-ring svg { transform: rotate(-90deg); }
.focus-ring circle { transition: stroke-dashoffset 1s linear; }
.focus-clock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus-clock b { font-family: var(--font-display); font-weight: 300; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; }
.focus-clock small { color: var(--muted); margin-top: 6px; }
.focus-goal { margin: 0; font-size: 17px; }
.focus-locked { display: flex; flex-direction: column; align-items: center; }
.focus-locked .focus-apps { justify-content: center; }
.focus-departures { margin: 0; font-size: 14px; }
.focus-actions { justify-content: center; }
.focus-done .big { font-size: 56px; line-height: 1; }
.focus-done .stats { width: 100%; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) {
  .focus-ring { width: 210px; height: 210px; }
  .focus-ring svg { width: 210px; height: 210px; }
  .focus-clock b { font-size: 46px; }
  .focus-start { align-self: stretch; }
  .nav a { font-size: 10px; }
}

/* ---------- Formules : mensuel / annuel, quotas QCM et podcasts ---------- */
.pw-period {
  align-self: center; display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px;
  background: color-mix(in srgb, var(--panel2) 85%, transparent); border: 1px solid var(--glass-border);
}
.pw-period button { border: 0; background: none; padding: 8px 18px; font-size: 14px; color: var(--muted); }
.pw-period button.active { background: var(--primary); color: var(--primary-ink); }
.pw-save { margin-left: 4px; padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #2c2416; font-size: 11.5px; font-weight: 600; }
.paywall .per-year { display: none; }
.paywall.year .per-month { display: none; }
.paywall.year .per-year { display: block; }
.pw-plan li.no { color: var(--muted); opacity: 0.7; }
.pw-plan li.no::before { content: "– "; color: var(--muted); }
.quota-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; }
.lock-tag { margin-left: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--primary); color: var(--gold); white-space: nowrap; }

/* Changement de formule en cours de période : pas de baisse */
.pw-plan.lower { opacity: 0.5; filter: grayscale(0.4); }
.pw-plan.lower::before { content: "🔒 À ta prochaine échéance"; position: absolute; bottom: 10px; left: 14px; right: 14px; font-size: 11px; color: var(--muted); }
.pw-plan.lower ul { margin-bottom: 18px; }
.pw-lock-note { margin: 0; max-width: 460px; text-align: center; font-size: 13px; color: var(--muted); }
