/* ============================================================================
   The Millionaire's Library v2 — thème « académie privée »
   Mode clair parchemin/laiton validé par Dany (maquette 22 août 2026).
   ============================================================================ */
:root {
  --bg: #eadfc3;            /* parchemin */
  --surface: #fffdf6;       /* papier */
  --surface2: #f6efdd;
  --text: #241f12;          /* brun encre */
  --muted: #77694a;
  --gold: #9c7c2f;          /* laiton profond */
  --gold-deep: #7a5c1c;
  --gold-soft: rgba(156, 124, 47, .12);
  --line: #d3c49e;          /* filets */
  --green: #4a6b48;
  --red: #8a3a2e;
  --radius: 14px;
  --reader-size: 18px;
  --shadow: 0 3px 16px rgba(90, 72, 30, .18);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  /* `manipulation` : supprime le zoom au double-tap SANS bloquer le glissement
     horizontal du curseur de lecture ; overflow-x coupe la dérive latérale */
  touch-action: manipulation;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh; overscroll-behavior: none;
}
button { font-family: inherit; }
.screen { display: none; min-height: 100vh; padding-bottom: 140px; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ===== Écran de veille (chargement / accès) ===== */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 30px;
}
.gate .logo {
  font-family: Georgia, serif; font-size: 30px; font-weight: 700; margin-bottom: 6px;
}
.gate .logo em { color: var(--gold-deep); font-style: italic; }
.gate p { color: var(--muted); margin-top: 10px; font-size: 15px; }
.gate a.chip { text-decoration: none; display: inline-block; margin-top: 22px; }

/* ===== En-tête ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 10px;
  position: sticky; top: 0; background: linear-gradient(var(--bg) 78%, transparent); z-index: 5;
}
.brand { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 700; }
.brand em { color: var(--gold-deep); font-style: italic; }
.brand small {
  display: block; font-family: -apple-system, sans-serif; font-size: 9.5px;
  letter-spacing: 2.6px; color: var(--muted); text-transform: uppercase; margin-top: 2px;
}
.portal-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  border-radius: 100px; padding: 8px 13px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; box-shadow: var(--shadow); margin-right: 10px; white-space: nowrap; flex: none;
}
.topbar .right { display: flex; align-items: center; }
.avatar {
  flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #c9a44a, #8a6420);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fdfaf1; box-shadow: var(--shadow);
}
.tabs { display: flex; gap: 8px; padding: 8px 20px 14px; }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 0; border-radius: 100px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); cursor: pointer;
}
.tab svg { width: 17px; height: 17px; }
.tab.on {
  background: var(--surface); color: var(--gold-deep);
  border-color: rgba(156,124,47,.45); box-shadow: var(--shadow);
}

.searchbar {
  margin: 0 20px 16px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); color: var(--muted); font-size: 15px;
  border: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; opacity: .6;
}

h2.rowtitle { font-family: Georgia, serif; font-size: 17px; font-weight: 700; margin: 6px 20px 12px; }
h2.rowtitle small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; font-family: -apple-system, sans-serif; }

/* ===== Grille revues ===== */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 20px 20px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(6, 1fr); } }
.mag {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.mag img { width: 100%; aspect-ratio: 595/842; object-fit: cover; display: block; background: var(--surface2); }
.mag .meta { padding: 10px 12px 12px; }
.mag .meta b { font-size: 14px; display: block; font-family: Georgia, serif; }
.mag .meta span { font-size: 12px; color: var(--muted); }
.mag .readbar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.mag .readbar i { display: block; height: 100%; background: var(--gold); }

/* ===== Liste épisodes ===== */
.eplist { max-width: 860px; padding-bottom: 80px; }
@media (min-width: 900px) { .eplist { margin: 0 auto; } }
.ep { display: flex; align-items: center; gap: 14px; padding: 12px 20px; cursor: pointer; }
.ep .num {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: var(--surface); border: 1px solid rgba(156,124,47,.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-deep); font-weight: 800; font-size: 13px; font-family: Georgia, serif;
  box-shadow: var(--shadow);
}
.ep .info { flex: 1; min-width: 0; }
.ep .info b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .info span { font-size: 12.5px; color: var(--muted); }
.ep .fav { color: var(--gold-deep); font-size: 13px; margin-right: 4px; }
.ep .state { flex: none; font-size: 12px; color: var(--muted); text-align: right; }
.ep .state .done { color: var(--green); font-size: 16px; }
.ep .pbar { width: 52px; height: 3px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.ep .pbar i { display: block; height: 100%; background: var(--gold); }

/* ===== Carte « reprendre » ===== */
.art {
  margin: 0 20px 12px; padding: 15px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  box-shadow: var(--shadow);
}
.art b { font-size: 15.5px; display: block; line-height: 1.35; font-family: Georgia, serif; }
.art span { color: var(--muted); font-size: 12.5px; display: block; margin-top: 5px; }
.art .rp { height: 3px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.art .rp i { display: block; height: 100%; background: var(--gold); }

/* ===== Mini-lecteur ===== */
.mini {
  position: fixed; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom, 14px)); z-index: 8;
  background: rgba(255,253,246,.98); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(90,72,30,.22); cursor: pointer;
}
.mini .cover {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #c9a44a, #7a5c1c);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px; color: #fdfaf1; font-family: Georgia, serif;
}
.mini .t { flex: 1; min-width: 0; }
.mini .t b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .t span { font-size: 11.5px; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.mini button { background: none; border: none; color: var(--text); cursor: pointer; padding: 4px 8px; display: flex; align-items: center; }
.mini button svg { width: 24px; height: 24px; }
.mini .prog { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--line); border-radius: 2px; }
.mini .prog i { display: block; height: 100%; width: 0%; background: var(--gold); }

/* ===== Barre d'onglets ===== */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: flex; background: rgba(234,223,195,.97); border-top: 1px solid var(--line);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 14px));
}
.navbar .nav { flex: 1; text-align: center; color: var(--muted); font-size: 11px; cursor: pointer; border: none; background: none; }
.navbar .nav .ico { display: block; margin: 0 auto 3px; width: 22px; height: 22px; }
.navbar .nav .ico svg { width: 22px; height: 22px; }
.navbar .nav.on { color: var(--gold-deep); }
.navbar .nav.soon { opacity: .45; }

/* ===== Lecteur plein écran ===== */
#screen-player { background: radial-gradient(120% 60% at 50% 0%, #e2d0a2 0%, var(--bg) 60%); }
.player-wrap { padding: calc(20px + env(safe-area-inset-top, 0px)) 26px 20px; display: flex; flex-direction: column; min-height: 92vh; max-width: 560px; margin: 0 auto; }
.player-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.player-top button { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.artwork {
  margin: 30px auto 0; width: min(72vw, 300px); aspect-ratio: 1;
  border-radius: 22px; background: linear-gradient(140deg, #dcbb62, #8a6420 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fdf8ea; box-shadow: 0 24px 55px rgba(122,92,28,.35);
  border: 1px solid rgba(255,252,240,.5);
}
.artwork b { font-size: 42px; letter-spacing: 2px; font-family: Georgia, serif; }
.artwork span { font-size: 12px; font-weight: 700; margin-top: 4px; letter-spacing: 2.5px; }
.ptitle { text-align: center; margin-top: 26px; }
.ptitle b { font-size: 18px; display: block; font-family: Georgia, serif; line-height: 1.3; }
.ptitle span { color: var(--muted); font-size: 13.5px; }
.scrub { margin-top: 26px; }
.scrub input[type=range] {
  width: 100%; appearance: none; -webkit-appearance: none; height: 22px; background: transparent; cursor: pointer;
}
.scrub input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) var(--pct, 0%), #cfc096 var(--pct, 0%));
}
.scrub input[type=range]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); margin-top: -5.5px;
  box-shadow: var(--shadow);
}
.scrub .times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pcontrols { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 20px; }
.pcontrols .skip { background: none; border: none; color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; }
.pcontrols .skip span { display: block; font-size: 20px; }
.bigplay svg { width: 32px; height: 32px; }
.bigplay {
  width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(140deg, #b3903a, #7a5c1c); color: #fdf8ea;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(122,92,28,.4);
}
.pfoot { display: flex; justify-content: center; gap: 10px; align-items: center; margin-top: auto; padding-top: 26px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 100px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}
.chip.gold { color: var(--gold-deep); border-color: rgba(156,124,47,.5); }
.chip.soon { opacity: .5; }

/* ===== Sommaire d'une revue ===== */
.issue-head { display: flex; gap: 16px; padding: 6px 20px 18px; max-width: 860px; }
.issue-head img { width: 108px; align-self: flex-start; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.issue-head .d b { font-size: 18px; display: block; margin-bottom: 4px; font-family: Georgia, serif; }
.issue-head .d span { color: var(--muted); font-size: 13.5px; display: block; margin-bottom: 10px; }
.toclist { max-width: 860px; }
@media (min-width: 900px) { .issue-head, .toclist { margin: 0 auto; } }

/* ===== Mode lecture 1 colonne ===== */
#screen-reader { background: #f6efdc; }
.reader-top {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px; background: #f6efdc; border-bottom: 1px solid var(--line);
}
.reader-top button { background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.reader-top .where { font-size: 11px; color: var(--muted); text-align: center; flex: 1; text-transform: uppercase; letter-spacing: 2px; }
.readprog { position: sticky; top: calc(53px + env(safe-area-inset-top, 0px)); z-index: 6; height: 3px; background: var(--line); }
.readprog i { display: block; height: 100%; width: 0%; background: var(--gold); transition: width .15s; }
.reader {
  max-width: 640px; margin: 0 auto; padding: 34px 24px 40px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size); line-height: 1.78; color: #33291a;
}
.reader h1 { font-size: 30px; line-height: 1.22; color: var(--text); margin-bottom: 10px; font-weight: 700; }
.reader .byline {
  font-family: -apple-system, sans-serif; color: var(--gold-deep); font-size: 13px;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.reader .rtime { font-family: -apple-system, sans-serif; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.reader .rule { border: none; border-top: 1px solid var(--line); margin: 0 0 26px; position: relative; }
.reader .rule::after {
  content: "❦"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: #f6efdc; padding: 0 12px; color: var(--gold); font-size: 14px;
}
.reader h2 { font-size: 23px; color: var(--text); margin: 38px 0 13px; line-height: 1.28; }
.reader h3 { font-size: 19px; color: var(--gold-deep); margin: 28px 0 10px; font-style: italic; }
.reader p { margin-bottom: 1em; }
.reader p.lettrine::first-letter {
  color: var(--gold-deep); font-size: 3.1em; font-weight: 700;
  float: left; line-height: .85; padding: 4px 8px 0 0;
}
.endmark { text-align: center; color: var(--gold); margin: 40px 0 10px; font-size: 18px; }
.reader-next { max-width: 640px; margin: 0 auto; padding: 0 24px 60px; }
.reader-next .art { margin: 0 0 12px; }

/* ===== États vides / messages ===== */
.empty { text-align: center; color: var(--muted); padding: 40px 30px; font-size: 14.5px; }

/* ===== Surlignement ===== */
mark[data-hl], mark.flash {
  background: rgba(212, 168, 67, .38);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
  cursor: pointer;
}
mark.flash { animation: hlflash 2.2s ease-out 2; }
@keyframes hlflash {
  0% { background: rgba(212, 168, 67, .85); }
  100% { background: rgba(212, 168, 67, .38); }
}
#hl-toolbar {
  position: absolute; z-index: 30; display: none;
}
#hl-toolbar.on { display: block; }
#hl-toolbar button {
  background: var(--text); color: var(--surface);
  border: none; border-radius: 100px; padding: 10px 18px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* ===== Feuille modale ===== */
#sheet {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(36, 31, 18, .45);
  align-items: flex-end; justify-content: center;
}
#sheet.on { display: flex; }
.sheet-box {
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 -10px 40px rgba(90,72,30,.3);
}
.sheet-title { font-family: Georgia, serif; font-weight: 700; font-size: 17px; }
.sheet-excerpt { color: var(--muted); font-size: 13.5px; font-family: Georgia, serif; line-height: 1.5; }
.sheet-box .chip { text-align: center; padding: 13px 16px; }

/* ===== Toast ===== */
#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--surface);
  border-radius: 100px; padding: 11px 22px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 50;
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Partages reçus ===== */
.inbox-card { border-left: 3px solid var(--gold); }
.inbox-card .excerpt {
  font-family: Georgia, serif; font-style: italic; color: var(--text);
  margin-top: 6px; line-height: 1.5;
}

/* ===== Cartes de collection (écran de sélection de la section Lire) ===== */
.colcard {
  margin: 0 20px 14px; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; gap: 16px;
}
.colcard .fan { position: relative; width: 100px; height: 96px; flex: none; }
.colcard .fan img {
  position: absolute; width: 62px; aspect-ratio: 595/842; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(90,72,30,.25); background: var(--surface2);
}
.colcard .fan img:nth-child(1) { left: 0;    top: 10px; transform: rotate(-7deg); }
.colcard .fan img:nth-child(2) { left: 17px; top: 4px;  transform: rotate(-1deg); }
.colcard .fan img:nth-child(3) { left: 34px; top: 8px;  transform: rotate(6deg); z-index: 2; }
.colcard .d { flex: 1; min-width: 0; }
.colcard .d b { font-family: Georgia, serif; font-size: 17px; display: block; line-height: 1.3; }
.colcard .d b em { color: var(--gold-deep); font-style: italic; }
.colcard .d span { color: var(--muted); font-size: 13px; display: block; margin-top: 4px; }
.colcard .arrow { color: var(--gold); font-size: 20px; flex: none; }

/* ===== Mode surlignage ===== */
#hl-mode-btn.on { color: var(--gold-deep); background: var(--gold-soft); border-radius: 8px; }
.hl-banner {
  display: none; position: sticky; top: calc(53px + env(safe-area-inset-top, 0px)); z-index: 6;
  margin: 0; padding: 10px 16px;
  background: #eadfbe; border-bottom: 1px solid rgba(156,124,47,.35);
  color: var(--gold-deep); font-size: 13.5px; font-weight: 600;
  align-items: center; justify-content: space-between; gap: 12px;
}
.hl-banner.on { display: flex; }
.hl-banner .chip { padding: 7px 14px; font-size: 13px; }
.hl-mode .reader p { cursor: pointer; }
.hl-mode .reader p:active { background: rgba(156,124,47,.07); }

/* ===== Visibilité des surlignements ===== */
.visbtn { display: inline-flex; align-items: center; gap: 7px; }
.visbtn svg { width: 17px; height: 17px; }
mark.other {
  background: transparent;
  border-bottom: 2px dotted var(--gold);
  color: inherit; padding: 0 1px; cursor: pointer;
}
.sheet-owner { font-family: -apple-system, sans-serif; font-size: 13px; color: var(--muted); }
.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
  font-size: 15px; cursor: pointer;
}
.member-row input { width: 19px; height: 19px; accent-color: var(--gold-deep); }

/* ===== Écran Favoris ===== */
#favs-body .art .vis { float: right; }
#favs-body .art .vis svg { width: 15px; height: 15px; }
#favs-body .excerpt {
  font-family: Georgia, serif; font-style: italic; color: var(--text);
  margin-top: 6px; line-height: 1.5; display: block;
}

/* ===== Popover d'annotation (style commentaire Acrobat) ===== */
#popover {
  position: absolute; z-index: 35;
  width: min(330px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 36px rgba(90,72,30,.3);
  padding: 12px 14px;
  font-family: -apple-system, sans-serif;
}
#popover .po-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#popover .po-head b { font-size: 13.5px; }
#popover .po-head span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
#popover .po-close {
  background: none; border: none; color: var(--muted); font-size: 17px;
  cursor: pointer; padding: 0 2px; line-height: 1;
}
#popover .po-thread { max-height: 170px; overflow-y: auto; margin-top: 8px; }
#popover .po-c { padding: 7px 0; border-top: 1px solid var(--surface2); font-size: 13px; line-height: 1.45; }
#popover .po-c b { font-size: 12.5px; }
#popover .po-c span { color: var(--muted); font-size: 11px; margin-left: 6px; }
#popover .po-input { display: flex; gap: 8px; margin-top: 9px; }
#popover .po-input input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--surface2); color: var(--text); font-size: 13px; min-width: 0;
}
#popover .po-send {
  background: var(--gold-deep); color: #fdf8ea; border: none; border-radius: 100px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; flex: none;
}
#popover .po-vis { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
#popover .po-vis button {
  flex: none; width: 36px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#popover .po-vis button svg { width: 16px; height: 16px; }
#popover .po-vis button.act { background: var(--gold-soft); color: var(--gold-deep); border-color: rgba(156,124,47,.5); }
#popover .po-vis .del { margin-left: auto; color: var(--red); }
#popover .po-hint { color: var(--muted); font-size: 11.5px; margin-top: 8px; }

/* ===== Couleur des icônes de visibilité selon l'état ===== */
.vis-c-private { color: var(--muted); }
.vis-c-all { color: var(--green); }
.vis-c-users { color: var(--gold-deep); }
.vis-c-private svg, .vis-c-all svg, .vis-c-users svg { color: inherit; }
#popover .po-vis button.act.vis-c-all {
  color: var(--green); border-color: rgba(74,107,72,.5); background: rgba(74,107,72,.12);
}
#popover .po-vis button.act.vis-c-users {
  color: var(--gold-deep); border-color: rgba(156,124,47,.5); background: var(--gold-soft);
}
#popover .po-vis button.act.vis-c-private {
  color: var(--text); border-color: var(--line); background: var(--surface);
}

/* Le bouton du bandeau : la couleur d'état gagne sur le style du chip */
.chip.visbtn.vis-c-private { color: var(--muted); border-color: var(--line); }
.chip.visbtn.vis-c-all { color: var(--green); border-color: rgba(74,107,72,.5); }
.chip.visbtn.vis-c-users { color: var(--gold-deep); border-color: rgba(156,124,47,.5); }

/* ===== Menu contextuel du passage en cours (bas d'écran) ===== */
#hl-context {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom, 14px));
  z-index: 25; max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 12px 36px rgba(90,72,30,.3);
  font-family: -apple-system, sans-serif;
}
#hl-context .po-head b { font-size: 13.5px; }
#hl-context .po-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#hl-context .po-head span { color: var(--muted); font-size: 11.5px; }
#hl-context .po-vis { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
#hl-context .po-vis button {
  flex: none; width: 38px; height: 33px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#hl-context .po-vis button svg { width: 16px; height: 16px; }
#hl-context .po-vis button.act.vis-c-all { color: var(--green); border-color: rgba(74,107,72,.5); background: rgba(74,107,72,.12); }
#hl-context .po-vis button.act.vis-c-users { color: var(--gold-deep); border-color: rgba(156,124,47,.5); background: var(--gold-soft); }
#hl-context .po-vis button.act.vis-c-private { color: var(--text); border-color: var(--line); background: var(--surface); }
#hl-context .po-vis .del { margin-left: auto; color: var(--red); }
#hl-context .po-input { display: flex; gap: 8px; margin-top: 10px; }
#hl-context .po-input input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--surface2); color: var(--text); font-size: 13px; min-width: 0;
}
#hl-context .po-send {
  background: var(--gold-deep); color: #fdf8ea; border: none; border-radius: 100px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; flex: none;
}
/* Note privée dans un fil */
.po-c .prive-tag {
  font-size: 10px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 100px;
  padding: 1px 7px; margin-left: 6px; vertical-align: 1px;
}

/* ===== Listes à puces et emphase dans le lecteur ===== */
.reader p.li { padding-left: 1.2em; position: relative; margin-bottom: .5em; }
.reader p.li::before {
  content: "•"; color: var(--gold-deep); position: absolute; left: .2em; top: 0;
}
.reader b { font-weight: 700; }
.reader i { font-style: italic; }
.reader mark b, .reader mark i { background: transparent; }

/* Intertitre gras du corps (paragraphe entièrement en gras) */
.reader p.sub { font-size: 1.06em; margin: 1.5em 0 .6em; line-height: 1.4; }

/* ===== Typographie du journal (fontes des PDF, auto-hébergées) ===== */
/* Revue Millionaire Mindset : Barlow + Barlow Condensed (titres) */
.reader-mm .reader {
  font-family: 'Barlow', -apple-system, sans-serif;
  line-height: 1.6; color: #2e2a20;
}
.reader-mm .reader h1 {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  font-size: 34px; line-height: 1.12;
}
.reader-mm .reader h2, .reader-mm .reader h3 {
  font-family: 'Barlow', sans-serif; font-weight: 700; font-style: normal;
}
.reader-mm .reader h3 { color: var(--text); }
/* Analyses The Millionaire's Library : Overpass (léger comme le PDF) */
.reader-ep .reader {
  font-family: 'Overpass', -apple-system, sans-serif;
  font-weight: 300; line-height: 1.66; color: #2e2a20;
}
.reader-ep .reader b { font-weight: 700; }
.reader-ep .reader h1, .reader-ep .reader h2, .reader-ep .reader h3 {
  font-family: 'Overpass', sans-serif; font-weight: 700; font-style: normal;
}
.reader-ep .reader h3 { color: var(--gold-deep); }
/* Fidélité au journal : pas de lettrine décorative sur ces typos */
.reader-mm .reader p.lettrine::first-letter,
.reader-ep .reader p.lettrine::first-letter {
  color: inherit; font-size: inherit; font-weight: inherit;
  float: none; padding: 0; line-height: inherit;
}

/* ===== Photos des revues dans le flux de lecture ===== */
.reader figure.illus { margin: 1.4em 0; }
.reader figure.illus img {
  width: 100%; max-height: 70vh; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ===== Rangée de classement des listes ===== */
.sortrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 20px 14px; }
.sortrow .sortchip { font-size: 12.5px; padding: 6px 12px; }
.sortrow .sortchip.on {
  background: var(--gold);
  color: #fffdf6;
  border-color: var(--gold);
}

/* ===== Surlignement audio : marqueurs sur la barre + outils d'extrait ===== */
.scrub { position: relative; }
#scrub-marks {
  position: absolute; top: -4px; left: 0; right: 0; height: 12px;
  pointer-events: none; z-index: 2;
}
#scrub-marks .smark {
  position: absolute; top: 0; width: 11px; height: 11px; border-radius: 50%;
  pointer-events: auto; cursor: pointer; border: 2px solid #fffdf6;
  box-shadow: 0 1px 3px rgba(60,45,20,.35);
}
#scrub-marks .smark.vis-c-private { background: #8d8677; }
#scrub-marks .smark.vis-c-all { background: var(--green); }
#scrub-marks .smark.vis-c-users { background: var(--gold); }
#scrub-marks .smark.other { background: #fffdf6; border: 2px dotted var(--gold-deep); }
.po-audio { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; }
.po-audio .chip { font-size: 12.5px; padding: 7px 12px; }
.po-close {
  border: none; background: none; font-size: 17px;
  color: var(--muted); cursor: pointer; padding: 0 2px; line-height: 1;
}
#hl-audio-chip.on { background: var(--gold); color: #fffdf6; border-color: var(--gold); }

/* ===== Recherche dans les revues ===== */
.searchbar {   /* complète la règle de la maquette (plus haut) : rendue ACTIVE */
  display: flex; text-align: left; cursor: pointer;
  box-shadow: var(--shadow); opacity: 1; font-family: inherit;
}
#search-input {
  display: block; width: calc(100% - 40px); box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 13px 16px; font-size: 16px; font-family: inherit;
  margin: 0 20px 12px; box-shadow: var(--shadow);
}
#search-input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.search-hit { position: relative; }
.search-hit .excerpt mark {
  background: rgba(156, 124, 47, .28); color: inherit;
  border-radius: 3px; padding: 0 1px;
}
.search-hit .share-art {
  margin-top: 9px; font-size: 12.5px; padding: 6px 12px; align-self: flex-start;
}

/* Bouton d'écoute d'un article (lecteur de texte) */
.reader .listen-art, #reader-body .listen-art {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 12px 0 4px; font-size: 13px;
  color: var(--gold-deep); border-color: rgba(156,124,47,.5);
}
