/* Fondations partagées : thèmes, échelle et composants de base. */
:root {
  color-scheme: light;
  --sidebar-width: 0px;
  --bg: #f7f4ee;
  --panel: #ffffff;
  --panel-2: #fbfaf7;
  --panel-strong: #f0ebe2;
  --text: #201d1a;
  --draft: #593b7d;
  --muted: #6f6861;
  --line: #ded8cf;
  --line-strong: #c9bfb3;
  --brand: #a44725;
  --brand-dark: #7c3219;
  --brand-soft: #f7e8df;
  --button-primary: #a44725;
  --button-danger: #a91f29;
  --world: #287d78;
  --campaign: #a26817;
  --scenario: #9a3d55;
  --danger: #b4232d;
  --success: #237a4b;
  --info: #326ca8;
  --shadow-sm: 0 2px 8px rgba(37, 30, 24, .06);
  --shadow: 0 14px 38px rgba(37, 30, 24, .09);
  --shadow-lg: 0 24px 70px rgba(37, 30, 24, .16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --target-min: 42px;
  --target-touch: 44px;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Iowan Old Style, Palatino Linotype, Book Antiqua, Palatino, Georgia, serif;
  font-family: var(--font-ui);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171513;
  --panel: #211e1b;
  --panel-2: #292521;
  --panel-strong: #332d28;
  --text: #f6f1ea;
  --draft: #a38cbe;
  --muted: #b8afa6;
  --line: #443d36;
  --line-strong: #5b5046;
  --brand: #e18459;
  --brand-dark: #f2aa7f;
  --brand-soft: #3c2921;
  --button-primary: #a04428;
  --button-danger: #a91f29;
  --world: #67bdb5;
  --campaign: #e2ad53;
  --scenario: #df8197;
  --danger: #ef6a72;
  --success: #63bf86;
  --info: #78afe4;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .18);
  --shadow: 0 16px 42px rgba(0, 0, 0, .28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .42);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #171513;
    --panel: #211e1b;
    --panel-2: #292521;
    --panel-strong: #332d28;
    --text: #f6f1ea;
    --draft: #a38cbe;
    --muted: #b8afa6;
    --line: #443d36;
    --line-strong: #5b5046;
    --brand: #e18459;
    --brand-dark: #f2aa7f;
    --brand-soft: #3c2921;
    --button-primary: #a04428;
    --button-danger: #a91f29;
    --world: #67bdb5;
    --campaign: #e2ad53;
    --scenario: #df8197;
    --danger: #ef6a72;
    --success: #63bf86;
    --info: #78afe4;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .18);
    --shadow: 0 16px 42px rgba(0, 0, 0, .28);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, .42);
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body { min-width: 320px; margin: 0; color: var(--text); background: var(--bg); font-family: var(--font-ui); line-height: 1.55; }
button, input, select, textarea { font-family: var(--font-ui); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.counter-bubble { display: inline-flex; justify-content: center; align-items: center; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); color: var(--muted); font-size: .68rem; line-height: 1.2; text-align: center; vertical-align: middle; }
h1, h2 { font-family: var(--font-display); }
h1 { margin: 0 0 8px; color: var(--text); font-size: clamp(1.75rem, 3.2vw, 2.75rem); font-weight: 700; line-height: 1.05; letter-spacing: -.035em; }
h2 { margin: 0 0 14px; font-size: 1.25rem; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
h3 { margin: 0 0 10px; font-size: 1rem; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-sm); }
.card:hover { border-color: var(--line-strong); }
.card.pad { padding: clamp(17px, 1.8vw, 22px); }
.cover { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; background: var(--line); }
.card-body { padding: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button, button, input[type=submit] { display: inline-flex; min-height: var(--target-min); justify-content: center; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 11px; background: var(--button-primary, var(--brand)); color: #fff; font-weight: 700; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button:hover, button:hover, input[type=submit]:hover { text-decoration: none; transform: translateY(-1px); }
.button.secondary, button.secondary { border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.button.secondary:hover, button.secondary:hover { border-color: var(--line-strong); background: var(--panel-2); }
.button.danger, button.danger { background: var(--button-danger, var(--danger)); }
.button.small, button.small { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: .88rem; }
.button.link, button.link {
  background: transparent;
  color: var(--brand);
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: auto;
  font-weight: inherit;
  box-shadow: none;
  transform: none;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.button.link:hover, button.link:hover {
  background: transparent;
  color: var(--brand-dark, var(--brand));
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}
.icon-button { width: var(--target-min); min-width: var(--target-min); padding: 0; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: .9rem; font-weight: 700; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea { width: 100%; min-height: var(--target-touch); padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); font: inherit; transition: border-color .16s ease, box-shadow .16s ease; }
input:not([type="radio"]):not([type="checkbox"]):hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:not([type="radio"]):not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); outline: 0; }
input[type="radio"], input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  cursor: pointer;
  accent-color: var(--brand);
  margin: 0;
  vertical-align: middle;
}
textarea { min-height: 150px; resize: vertical; }
.flash { padding: 12px 14px; border-radius: 14px; margin: 0 0 12px; background: var(--panel-2); border: 1px solid var(--line); }
.flash.error { border-color: rgba(178,49,49,.45); color: var(--danger); }
.flash.success { border-color: rgba(40,122,75,.45); color: var(--success); }
body:has(.editor-wrap:not(.editor-readonly)) .element-pagination { display: none !important; }
.editor-wrap:not(.editor-readonly) .note-editable { background: var(--panel-2) !important; color: var(--text); min-height: 360px; }

.note-editor.note-frame .note-editable {
  background: var(--panel-2) !important;
  color: var(--text);
}

.note-editor .note-dropdown-menu.dropdown-style :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger) {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-family: var(--font-ui) !important;
  min-height: auto !important;
  max-width: none !important;
  border-radius: 0 !important;
  display: block !important;
}

.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item:has(.texte-a-lire) {
  border-top: 1px solid var(--line) !important;
  margin-top: 4px !important;
  padding-top: 6px !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

@media (min-width: 768px) {
  /* Annulation du séparateur de citation sur grand écran car c'est le premier élément de la colonne de droite */
  .note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item:has(.texte-a-lire) {
    border-top: none !important;
    margin-top: 0 !important;
    padding-top: 4px !important;
  }
}

/* Styles pour les encadrés thématiques */
.note-editor .note-dropdown-menu.dropdown-style :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger) {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  border-left: 3px solid transparent !important;
  padding-left: 8px !important;
}

/* Bordures colorées thématiques de prévisualisation (vraies couleurs, spécificité renforcée) */
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .texte-a-lire { border-left-color: #a9b8c1 !important; font-style: italic !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .regles-du-jeu { border-left-color: #c9aa82 !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .jet-de-des { border-left-color: #c9aa82 !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .indice { border-left-color: #8a9be3 !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .revelation { border-left-color: #8a9be3 !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .secret-de-mj { border-left-color: #6e6e7c !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .note-au-mj { border-left-color: #6e6e7c !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .personnage { border-left-color: #9cc4a7 !important; }
.note-editor .note-dropdown-menu.dropdown-style a.note-dropdown-item .danger { border-left-color: #c58f89 !important; }

/* Icônes miniatures à la place des grandes icônes flottantes */
.note-editor .note-dropdown-menu.dropdown-style :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger)::before {
  content: "" !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  background: center / contain no-repeat !important;
  margin: 0 !important;
  float: none !important;
}

.note-editor .note-dropdown-menu.dropdown-style .texte-a-lire::before { background-image: url("/img/icones/texte-a-lire.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .regles-du-jeu::before { background-image: url("/img/icones/regles-du-jeu.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .jet-de-des::before { background-image: url("/img/icones/jet-de-des.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .indice::before { background-image: url("/img/icones/indice.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .revelation::before { background-image: url("/img/icones/revelation.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .secret-de-mj::before { background-image: url("/img/icones/secret-de-mj.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .note-au-mj::before { background-image: url("/img/icones/note-au-mj.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .personnage::before { background-image: url("/img/icones/personnage.png") !important; }
.note-editor .note-dropdown-menu.dropdown-style .danger::before { background-image: url("/img/icones/danger.png") !important; }
.editor-html, .note-editable {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.editor-html > :first-child, .note-editable > :first-child { margin-top: 0; }
.editor-html > :last-child, .note-editable > :last-child { margin-bottom: 0; }
.editor-html p, .note-editable p { max-width: none; margin: 0 0 1.15em; }
.editor-html ul, .editor-html ol, .note-editable ul, .note-editable ol { max-width: none; margin: 0 0 1.25em; padding-left: 1.6em; }
.editor-html li, .note-editable li { margin-bottom: .4em; padding-left: .2em; }
.editor-html h1, .editor-html h2, .editor-html h3, .editor-html h4, .editor-html h5, .editor-html h6, .note-editable h1, .note-editable h2, .note-editable h3, .note-editable h4, .note-editable h5, .note-editable h6 {
  max-width: none;
  color: var(--text);
  font-weight: 800;
  text-wrap: balance;
}
.editor-html h1, .note-editable h1 {
  margin: 0 0 .75em;
  padding-bottom: .28em;
  border-bottom: 2px solid color-mix(in srgb, var(--brand) 42%, var(--line));
  color: var(--brand-dark);
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.editor-html h2, .note-editable h2 {
  margin: 1.65em 0 .65em;
  padding-left: .55em;
  border-left: .18em solid var(--brand);
  color: var(--brand-dark);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.16;
  letter-spacing: -.03em;
}
.editor-html h3, .note-editable h3 {
  margin: 1.55em 0 .6em;
  color: color-mix(in srgb, var(--brand-dark) 82%, var(--text));
  font-size: clamp(1.45rem, 2.5vw, 1.7rem);
  line-height: 1.22;
  letter-spacing: -.02em;
}
.editor-html h4, .note-editable h4 {
  margin: 1.45em 0 .55em;
  font-size: 1.25rem;
  line-height: 1.3;
}
.editor-html h5, .note-editable h5 {
  margin: 1.4em 0 .5em;
  color: color-mix(in srgb, var(--brand) 78%, var(--text));
  font-size: 1.1rem;
  line-height: 1.35;
  letter-spacing: .015em;
}
.editor-html h6, .note-editable h6 {
  margin: 1.35em 0 .5em;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.editor-html blockquote, .note-editable blockquote {
  max-width: none;
  margin: 1.5em 0;
  padding: .15em 0 .15em 1.15em;
  border-left: 3px solid color-mix(in srgb, var(--brand) 55%, var(--line));
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}
.editor-html img, .note-editable img { max-width: 100%; height: auto; border-radius: 10px; }
.editor-html table, .note-editable table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.55em 0;
  font-size: 0.95rem;
}
.editor-html table th, .editor-html table td, .note-editable table th, .note-editable table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
}
.editor-html table th, .note-editable table th {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 750;
}
.editor-html table tr:hover, .note-editable table tr:hover {
  background-color: color-mix(in srgb, var(--brand) 4%, transparent);
}
.editor-html .media-action, .note-editable .media-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 2px 3px;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, var(--panel-2));
  color: var(--text);
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.editor-html .media-action:hover, .note-editable .media-action:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 20%, var(--panel-2)); text-decoration: none; }
.editor-html .media-action-audio, .note-editable .media-action-audio { border-color: #8a6dc7; background: color-mix(in srgb, #8a6dc7 16%, var(--panel-2)); }
.editor-html .media-action-image, .note-editable .media-action-image { border-color: #3b8798; background: color-mix(in srgb, #3b8798 16%, var(--panel-2)); }
.editor-html .media-action-reveal, .note-editable .media-action-reveal { border-color: #3b8798; background: color-mix(in srgb, #3b8798 16%, var(--panel-2)); }
.editor-html .media-action-reveal[aria-pressed="true"], .note-editable .media-action-reveal[aria-pressed="true"] { border-color: var(--success); background: color-mix(in srgb, var(--success) 20%, var(--panel-2)); }
.editor-html .media-action.is-sent, .note-editable .media-action.is-sent { border-color: var(--success); background: color-mix(in srgb, var(--success) 20%, var(--panel-2)); transform: translateY(-1px); }
.editor-html .media-action-disabled, .editor-html .media-action-disabled:hover, .note-editable .media-action-disabled, .note-editable .media-action-disabled:hover {
  border-color: var(--line) !important;
  background: var(--panel-2) !important;
  color: var(--muted) !important;
  opacity: .55;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
button:disabled, input[type=submit]:disabled { cursor: not-allowed; opacity: .48; }
.cover-choice-current { display: block; width: min(100%, 360px); aspect-ratio: 16 / 9; margin-bottom: 14px; object-fit: cover; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.cover-picker-modal { width: min(880px, calc(100vw - 32px)); }
.cover-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: min(62vh, 620px); overflow-y: auto; padding: 3px; }
.cover-picker-item { position: relative; display: grid; overflow: hidden; border: 2px solid transparent; border-radius: 14px; background: var(--panel-2); cursor: pointer; }
.cover-picker-item:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.cover-picker-item input { position: absolute; top: 9px; right: 9px; z-index: 1; width: 18px; height: 18px; accent-color: var(--brand); }
.cover-picker-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cover-picker-item span { padding: 9px 10px; font-size: .82rem; font-weight: 700; }
.media-action-image-choice { cursor: pointer; }
.media-action-editor-footer { display: flex; justify-content: flex-start; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.editor-html .texte-a-lire, .editor-html .regles-du-jeu, .editor-html .jet-de-des, .editor-html .indice, .editor-html .revelation, .editor-html .secret-de-mj, .editor-html .note-au-mj, .editor-html .personnage, .editor-html .danger, .note-editable .texte-a-lire, .note-editable .regles-du-jeu, .note-editable .jet-de-des, .note-editable .indice, .note-editable .revelation, .note-editable .secret-de-mj, .note-editable .note-au-mj, .note-editable .personnage, .note-editable .danger { margin: 28px 0 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; }

.editor-html .texte-a-lire, .note-editable .texte-a-lire { background: #e9eef2; color: #4b5d68; font-style: italic; border-color: #a9b8c1; }
.editor-html :is(.regles-du-jeu, .jet-de-des), .note-editable :is(.regles-du-jeu, .jet-de-des) { background: #f3e8d9; color: #3c2b18; border-color: #c9aa82; }
.editor-html :is(.indice, .revelation), .note-editable :is(.indice, .revelation) { background: #dce1f7; color: #2a346e; border-color: #8a9be3; }
.editor-html :is(.secret-de-mj, .note-au-mj), .note-editable :is(.secret-de-mj, .note-au-mj) { background: #41414b; color: #fff; border-color: #6e6e7c; }
.editor-html .personnage, .note-editable .personnage { background: #e6f0e9; color: #2e4d38; border-color: #9cc4a7; }
.editor-html .danger, .note-editable .danger { background: #f5e5e3; color: #6b302b; border-color: #c58f89; }

.editor-html .texte-a-lire::before, .editor-html .regles-du-jeu::before, .editor-html .jet-de-des::before, .editor-html .indice::before, .editor-html .revelation::before, .editor-html .secret-de-mj::before, .editor-html .note-au-mj::before, .editor-html .personnage::before, .editor-html .danger::before, .note-editable .texte-a-lire::before, .note-editable .regles-du-jeu::before, .note-editable .jet-de-des::before, .note-editable .indice::before, .note-editable .revelation::before, .note-editable .secret-de-mj::before, .note-editable .note-au-mj::before, .note-editable .personnage::before, .note-editable .danger::before { content: ""; float: left; width: 58px; height: 58px; margin: -30px 12px 2px 0; background: center / contain no-repeat; }

.editor-html .texte-a-lire::before, .note-editable .texte-a-lire::before { background-image: url("/img/icones/texte-a-lire.png"); }
.editor-html .regles-du-jeu::before, .note-editable .regles-du-jeu::before { background-image: url("/img/icones/regles-du-jeu.png"); }
.editor-html .jet-de-des::before, .note-editable .jet-de-des::before { background-image: url("/img/icones/jet-de-des.png"); }
.editor-html .indice::before, .note-editable .indice::before { background-image: url("/img/icones/indice.png"); }
.editor-html .revelation::before, .note-editable .revelation::before { background-image: url("/img/icones/revelation.png"); }
.editor-html .secret-de-mj::before, .note-editable .secret-de-mj::before { background-image: url("/img/icones/secret-de-mj.png"); }
.editor-html .note-au-mj::before, .note-editable .note-au-mj::before { background-image: url("/img/icones/note-au-mj.png"); }
.editor-html .personnage::before, .note-editable .personnage::before { background-image: url("/img/icones/personnage.png"); }
.editor-html .danger::before, .note-editable .danger::before { background-image: url("/img/icones/danger.png"); }

.editor-html :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger) a, .note-editable :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger) a { color: inherit; text-decoration: underline; }
.editor-html :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger) :is(h1, h2, h3, h4, h5, h6), .note-editable :is(.texte-a-lire, .regles-du-jeu, .jet-de-des, .indice, .revelation, .secret-de-mj, .note-au-mj, .personnage, .danger) :is(h1, h2, h3, h4, h5, h6) { color: inherit !important; }

@media (prefers-color-scheme: dark) {
  .editor-html .texte-a-lire, .note-editable .texte-a-lire { background: #122633; color: #b6c5cc; }
  .editor-html :is(.regles-du-jeu, .jet-de-des), .note-editable :is(.regles-du-jeu, .jet-de-des) { background: #302318; color: #f3e8d9; }
  .editor-html :is(.indice, .revelation), .note-editable :is(.indice, .revelation) { background: #152e40; color: #c5d5e0; }
  .editor-html .personnage, .note-editable .personnage { background: #193322; color: #c6ebd1; }
  .editor-html .danger, .note-editable .danger { background: #3d1d1a; color: #edc5c1; }
}

@media (width < 1024px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
}
.field-help { display: block; margin: 7px 0 0; color: var(--muted, #8d93a1); font-size: .88rem; line-height: 1.45; }

/* Home dashboard */
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.section-heading > .muted { margin: 0 0 3px; font-size: .86rem; }
.resume-card .button { margin-top: 8px; background: rgba(255,255,255,.94); color: #241f1a; }
.field-counter { justify-self: end; margin-top: -3px; color: var(--muted); }
.status-badge { display: inline-flex; gap: 6px; align-items: center; padding: 6px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(18,15,13,.78); color: #fff; font-size: .72rem; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.5); backdrop-filter: blur(7px); }
.card-stretched-link { display: inline-flex; gap: 7px; align-items: center; margin-top: 5px; font-size: .84rem; font-weight: 800; }
@media (width < 480px) {
  .share-link-row .button { width: 100%; }
}

.status-badge-inline { display: inline-flex; width: max-content; gap: 5px; align-items: center; font-size: .68rem; font-weight: 800; text-transform: uppercase; }

.skip-link { position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--text); color: var(--panel); font-weight: 800; transform: translateY(-160%); transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; }
.brand-logo { object-fit: contain; filter: invert(1); }
:root[data-theme="dark"] .brand-logo { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-logo, :root[data-theme="system"] .brand-logo { filter: none; }
}
.locale-switcher { display: inline-grid; grid-template-columns: repeat(2, minmax(34px, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.locale-switcher a { display: grid; min-height: 31px; place-items: center; border-radius: 8px; color: var(--muted); font-weight: 800; font-size: 0.78rem; text-decoration: none; }
.locale-switcher a:hover, .locale-switcher a[aria-current="true"] { background: var(--panel); color: var(--brand); box-shadow: var(--shadow-sm); }
.theme-switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.theme-switcher button { min-width: 0; min-height: 34px; padding: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.theme-switcher button[aria-pressed="true"] { background: var(--panel); color: var(--brand); box-shadow: var(--shadow-sm); }
.toast-region { position: fixed; top: 20px; right: 24px; z-index: 500; display: grid; width: min(390px, calc(100vw - 32px)); gap: 10px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px; gap: 10px; align-items: center; padding: 13px 12px 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in .24s ease both; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.success > i { color: var(--success); }
.toast.error > i { color: var(--danger); }
.toast-close { width: 30px; min-width: 30px; min-height: 30px; padding: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.toast.is-leaving { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(18px) scale(.98); } }

button.is-loading, .button.is-loading { position: relative; pointer-events: none; opacity: .78; }
button.is-loading > :not(.button-spinner), .button.is-loading > :not(.button-spinner) { visibility: hidden; }
.button-spinner { position: absolute; inset: 50% auto auto 50%; width: 17px; height: 17px; margin: -8.5px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .65s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }

@media (width < 1024px) {
  .toast-region { top: 74px; right: 16px; }
}

@media (width < 768px) {
  .topbar > .button { width: 100%; }
  .actions > .button, .actions > button { flex: 1 1 auto; }
}

:root[data-theme="light"] .editor-html .texte-a-lire, :root[data-theme="light"] .note-editable .texte-a-lire { background: #e9eef2; color: #4b5d68; }
:root[data-theme="light"] .editor-html :is(.regles-du-jeu, .jet-de-des), :root[data-theme="light"] .note-editable :is(.regles-du-jeu, .jet-de-des) { background: #f3e8d9; color: #3c2b18; }
:root[data-theme="light"] .editor-html :is(.indice, .revelation), :root[data-theme="light"] .note-editable :is(.indice, .revelation) { background: #dce1f7; color: #2a346e; }
:root[data-theme="light"] .editor-html .personnage, :root[data-theme="light"] .note-editable .personnage { background: #e6f0e9; color: #2e4d38; }
:root[data-theme="light"] .editor-html .danger, :root[data-theme="light"] .note-editable .danger { background: #f5e5e3; color: #6b302b; }
:root[data-theme="dark"] .editor-html .texte-a-lire, :root[data-theme="dark"] .note-editable .texte-a-lire { background: #122633; color: #b6c5cc; }
:root[data-theme="dark"] .editor-html :is(.regles-du-jeu, .jet-de-des), :root[data-theme="dark"] .note-editable :is(.regles-du-jeu, .jet-de-des) { background: #302318; color: #f3e8d9; }
:root[data-theme="dark"] .editor-html :is(.indice, .revelation), :root[data-theme="dark"] .note-editable :is(.indice, .revelation) { background: #1f244a; color: #c0c7f0; }
:root[data-theme="dark"] .editor-html .personnage, :root[data-theme="dark"] .note-editable .personnage { background: #193322; color: #c6ebd1; }
:root[data-theme="dark"] .editor-html .danger, :root[data-theme="dark"] .note-editable .danger { background: #3d1d1a; color: #edc5c1; }
@keyframes session-pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--success) 0%, transparent); } }

/* Premium plans and PayPal subscriptions */
.pricing-page { margin: calc(-1 * clamp(22px, 3vw, 40px)); }
.pricing-hero { padding: clamp(42px, 6vw, 76px) clamp(22px, 3vw, 40px) 92px; border-bottom: 1px solid var(--line); background:
  radial-gradient(circle at 82% 15%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 28rem),
  linear-gradient(145deg, color-mix(in srgb, var(--brand-soft) 68%, var(--bg)), var(--bg)); text-align: center;
  width: calc(100vw - var(--sidebar-width));
  margin-left: calc(50% - (100vw - var(--sidebar-width)) / 2);
  margin-right: calc(50% - (100vw - var(--sidebar-width)) / 2); }
.pricing-hero .back-link { width: fit-content; margin: 0 auto 28px; }
.pricing-hero h1 { max-width: 850px; margin: 0 auto 18px; font-size: clamp(2.4rem, 5vw, 4.25rem); text-wrap: balance; }
.pricing-hero > div > p:not(.eyebrow) { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 1.04rem; line-height: 1.75; }
.pricing-content { position: relative; margin-top: -58px; padding-bottom: 72px; }
.pricing-page:not(.pricing-page-public) .pricing-content { padding-inline: clamp(22px, 3vw, 40px); }
.pricing-grid { display: grid; gap: 14px; align-items: stretch; }
.pricing-grid-standard { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1080px; margin-inline: auto; }
.pricing-grid-with-private { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pricing-card { position: relative; display: flex; min-width: 0; min-height: 560px; flex-direction: column; padding: 24px 20px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.pricing-card.is-featured { border: 2px solid color-mix(in srgb, var(--brand) 72%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 48%, var(--panel)), var(--panel) 34%); transform: translateY(-10px); }
.pricing-card.is-current { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 45%, transparent), var(--shadow-sm); }
.pricing-popular, .pricing-private { position: absolute; top: -14px; right: 18px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 850; }
.pricing-private { background: var(--text); color: var(--panel); }
.pricing-card-head { display: flex; gap: 12px; align-items: center; }
.pricing-card-head .eyebrow { margin: 0; }
.pricing-card-head h2 { margin: 1px 0 0; font-size: 1.65rem; }
.pricing-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-size: 1.15rem; }
.pricing-icon-free { background: var(--panel-strong); color: var(--muted); }
.pricing-card-pro .pricing-icon { background: color-mix(in srgb, #d9a31b 17%, var(--panel)); color: #a46f00; }
.pricing-card-private .pricing-icon { background: color-mix(in srgb, #7357ad 17%, var(--panel)); color: #7357ad; }
.pricing-tagline { min-height: 3em; margin: 22px 0 8px; color: var(--muted); }
.pricing-price { display: flex; min-height: 72px; flex-wrap: wrap; gap: 5px 7px; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pricing-price strong { font-family: var(--font-display); font-size: clamp(1.65rem, 2.4vw, 2.2rem); line-height: 1; }
.pricing-price span { color: var(--muted); font-size: .75rem; }
.pricing-saving { min-height: 19px; margin: 8px 0 -8px; color: var(--success); font-size: .72rem; font-weight: 750; }
.pricing-features { display: grid; gap: 12px; margin: 22px 0 26px; padding: 0; list-style: none; }
.pricing-features li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; color: var(--text); font-size: .82rem; line-height: 1.45; }
.pricing-features li i { margin-top: 3px; color: var(--success); }
.pricing-features li.is-muted { color: var(--muted); }
.pricing-features li.is-muted i, .pricing-card-private .pricing-features li:last-child i { color: var(--muted); }
.pricing-card .pricing-cta, .pricing-card .pricing-current { width: 100%; margin-top: auto; text-align: center; }
.pricing-current { cursor: default; }
.pricing-reassurance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.pricing-reassurance > span { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.pricing-reassurance > span > i { grid-row: 1 / 3; color: var(--brand); font-size: 1.15rem; text-align: center; }
.pricing-reassurance strong { font-size: .82rem; }
.pricing-reassurance small { color: var(--muted); font-size: .7rem; }
.pricing-faq { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: 60px; margin-top: 64px; }
.pricing-faq h2 { font-size: 2rem; }
.pricing-faq-list { border-top: 1px solid var(--line); }
.pricing-faq-list details { border-bottom: 1px solid var(--line); }
.pricing-faq-list summary { display: flex; justify-content: space-between; gap: 20px; padding: 18px 4px; font-weight: 800; cursor: pointer; list-style: none; }
.pricing-faq-list summary::-webkit-details-marker { display: none; }
.pricing-faq-list details[open] summary i { transform: rotate(45deg); }
.pricing-faq-list p { margin: -6px 32px 20px 4px; color: var(--muted); line-height: 1.7; }

@media (width < 1280px) {
  .pricing-grid-standard, .pricing-grid-with-private { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-card.is-featured { transform: none; }
}

@media (width < 768px) {
  .pricing-page { margin: -76px -18px -28px; }
  .pricing-hero { padding: 100px 18px 78px; }
  .pricing-content { margin-top: -42px; }
  .pricing-grid-standard, .pricing-grid-with-private, .pricing-reassurance, .pricing-faq { grid-template-columns: 1fr; }
  .pricing-card { min-height: auto; }
  .pricing-card .pricing-cta, .pricing-card .pricing-current { margin-top: 16px; }
  .pricing-reassurance { margin-inline: 4px; }
  .pricing-faq { gap: 18px; margin-top: 48px; }
}

@media (width < 480px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

@media (width < 768px) {
  .card.pad { padding: 12px; }
  .card { border-radius: 15px; }
  .topbar .actions { width: 100%; }
  .resume-card .button { min-height: 38px; margin-top: 4px; }
  .editor-wrap .note-editable { padding: 12px !important; }
  .pricing-page { margin: -24px -12px -28px; }
  .pricing-hero { padding: 42px 12px 72px; }
}
.blog-admin-form > .card { overflow: visible; }
.blog-publish-panel .field { margin: 0; }
.notifications-header .muted { margin: 0; line-height: 1.55; }

.badge-owner {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-shared {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-favorite {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-public {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

/* Prevent combobox dropdown clipping in cards */
.card:has([data-world-combobox]) {
  overflow: visible !important;
}
