@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,600;0,700;0,800;0,900;1,900&display=swap');

/* =====================================================
   DIVINE CLASH — système de composants partagé
   Thème clair par défaut, sombre via html[data-theme=dark] (posé par /js/theme.js)
   ===================================================== */
:root {
  --bg: #f6f2e9; --bg-pat: rgba(227, 52, 63, .09);
  --panel: #fff7e3; --panel-2: #fbeccb; --panel-3: #ffffff;
  --border: #2a2733; --line: rgba(42, 39, 51, .16);
  --text: #1e1b26; --muted: #5d5867;
  --red: #e3343f; --red-d: #b51f2b; --accent: #f5c542; --accent-d: #c99412; --on-accent: #2a1d00;
  --blue: #2f7fe0; --green: #21a35b;
  --dlg-bg: #ffffff; --dlg-text: #1e1b26;
  --shadow: 0 4px 0 rgba(42, 39, 51, .22), 0 12px 24px rgba(42, 39, 51, .12);
  --sky1: #7fcbff; --sky2: #d8f1ff; --gr1: #a8dc86; --gr2: #5fae55; --plat1: #f1fbe6; --plat2: #a6d585; --plat3: #5c9f4c;
  --ui: 'Nunito', system-ui, sans-serif;
  /* Anciens noms encore lus par quelques scripts */
  --danger: var(--red); --ok: var(--green);
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #0d1730; --bg-pat: rgba(245, 197, 66, .08);
  --panel: #27324a; --panel-2: #1c2640; --panel-3: #323e59;
  --border: #070d1d; --line: rgba(255, 255, 255, .12);
  --text: #eef2fb; --muted: #aab5cb;
  --dlg-bg: #1b2643; --dlg-text: #f3f6fd;
  --shadow: 0 4px 0 rgba(0, 0, 0, .45), 0 14px 30px rgba(0, 0, 0, .4);
  --sky1: #141f4d; --sky2: #3b2f72; --gr1: #3c3f7a; --gr2: #1e2550; --plat1: #7c86c9; --plat2: #4b5398; --plat3: #2b3170;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; font-family: var(--ui); font-weight: 600; color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(circle, transparent 8px, var(--bg-pat) 9px, var(--bg-pat) 11px, transparent 12px),
                    radial-gradient(circle, var(--bg-pat) 3px, transparent 3.5px);
  background-size: 64px 64px, 64px 64px; background-position: 0 0, 32px 32px;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--red); }
a:hover { color: var(--red-d); }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
main { max-width: 1480px; margin: 0 auto; padding: 24px 40px; }

/* Motifs */
.pat { background-color: var(--bg);
  background-image: radial-gradient(circle, transparent 8px, var(--bg-pat) 9px, var(--bg-pat) 11px, transparent 12px),
                    radial-gradient(circle, var(--bg-pat) 3px, transparent 3.5px);
  background-size: 64px 64px, 64px 64px; background-position: 0 0, 32px 32px; }
.stripes { background-image: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .12) 0 14px, transparent 14px 28px); }

/* Icônes */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none; }
.ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
:root[data-theme=dark] .ico-sun { display: none; }
:root:not([data-theme=dark]) .ico-moon { display: none; }

/* Focus clavier et touches */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
kbd, .key { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--panel-3);
  color: var(--text); border: 2px solid var(--border); font: 900 11px var(--ui); line-height: 1; }

/* =====================================================
   EN-TÊTE
   ===================================================== */
.hdr { position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; gap: 32px; padding: 0 28px;
  background: var(--red); color: #fff; border-bottom: 4px solid var(--border); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: none; }
.logo:hover { color: #fff; }
.logo-halo { width: 34px; height: 34px; border-radius: 50%; border: 5px solid var(--accent); box-shadow: 0 0 0 3px var(--border), inset 0 0 0 3px var(--border); position: relative; flex: none; }
.logo-halo::after { content: ""; position: absolute; width: 7px; height: 44px; background: #fff; border: 2px solid var(--border); left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(35deg); border-radius: 3px; }
.logo-word { font-weight: 900; font-style: italic; font-size: 24px; letter-spacing: .02em; line-height: 1; text-shadow: 0 3px 0 var(--border); white-space: nowrap; }
.logo-word b { color: var(--accent); margin-left: 6px; -webkit-text-stroke: 1px var(--border); }
.nav { display: flex; gap: 6px; }
.nav-i { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; }
.nav-i:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-i.on { background: #fff; color: var(--red); box-shadow: 0 3px 0 var(--border); }
.nav-i.on:hover { color: var(--red); }
.hdr-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.gems { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 8px; border-radius: 999px; background: rgba(0, 0, 0, .25);
  font-weight: 900; font-size: 16px; color: #fff; text-decoration: none; font-variant-numeric: tabular-nums; }
.gems:hover { color: #fff; background: rgba(0, 0, 0, .35); }
.gems.bump-up { animation: gemUp .7s ease-out; }
.gems.bump-down { animation: gemDown .5s ease-out; }
@keyframes gemUp { 30% { transform: scale(1.15); box-shadow: 0 0 0 3px var(--accent); } }
@keyframes gemDown { 30% { transform: scale(.92); } }
.gem { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.gem svg { width: 16px; height: 16px; fill: #1aa6e8; }
.user { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; white-space: nowrap; }
.ub-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); border: 3px solid var(--border); position: relative; overflow: hidden; flex: none; }
.ub-avatar::before { content: ""; position: absolute; left: 50%; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--border); transform: translateX(-50%); }
.ub-avatar::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 26px; height: 18px; border-radius: 50%; background: var(--border); transform: translateX(-50%); }
.admin-tag { font-size: 11px; font-weight: 900; letter-spacing: .08em; background: var(--accent); color: var(--on-accent); border: 2px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--border); background: var(--panel-3); color: var(--text); display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 3px 0 var(--border); flex: none; padding: 0; text-decoration: none; }
.icon-btn:hover { color: var(--text); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.icon-btn .ic { width: 20px; height: 20px; }
.hdr .icon-btn { width: 40px; height: 40px; }

/* Barre d'onglets du bas (mobile) */
.m-tabs { display: none; }

/* =====================================================
   TITRES DE PAGE, ÉTAPES
   ===================================================== */
.ptitle { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 48px 0 28px; background: var(--red); color: #fff; font-weight: 900; font-size: 24px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 28px) 100%, 0 100%); text-shadow: 0 2px 0 rgba(0, 0, 0, .25); white-space: nowrap; }
.ptitle small { font-size: 14px; font-weight: 800; opacity: .85; }
.steps { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 13px; flex-wrap: wrap; }
.steps > .step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--panel-2); border: 2px solid var(--border); color: var(--muted); }
.steps > .step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); border: 2px solid var(--border); color: var(--text); font-size: 12px; }
.steps > .step.on { background: var(--accent); color: var(--on-accent); }
.steps > .step.done i { background: var(--green); color: #fff; }
.lbl { font-weight: 800; font-size: 14px; }
.lbl.caps { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }

/* =====================================================
   BOUTONS
   ===================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 3px solid var(--border);
  font: 900 16px/1 var(--ui); cursor: pointer; box-shadow: 0 4px 0 var(--border); text-decoration: none; color: var(--text); background: var(--panel-3); white-space: nowrap; }
.btn:hover { color: var(--text); filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--border); }
.btn-primary, .btn-primary:hover { background: var(--accent); color: var(--on-accent); }
.btn-red, .btn-red:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-lg { min-height: 64px; font-size: 22px; padding: 0 36px; }
.btn-sm { min-height: 36px; font-size: 14px; padding: 0 14px; box-shadow: 0 3px 0 var(--border); }
.btn .ico, .btn .ic { width: 22px; height: 22px; }
.btn-sm .ic { width: 16px; height: 16px; }

/* =====================================================
   PANNEAUX, CHAMPS, ONGLETS, PUCES
   ===================================================== */
.panel { background: var(--panel); border: 3px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 3px solid var(--border); background: var(--panel-2); border-radius: 17px 17px 0 0; font-weight: 900; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; }
.input,
input[type=text], input[type=number], input[type=password], input[type=search], input[type=email], select, textarea {
  height: 48px; border-radius: 12px; border: 3px solid var(--border); background: var(--panel-3); padding: 0 14px; font: 700 16px var(--ui); color: var(--text); width: 100%; }
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--muted); }
.input:focus, input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
textarea, textarea.input { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }
select, select.input { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
input[type=checkbox], input[type=radio] { accent-color: var(--red); width: 18px; height: 18px; }
input[type=range] { accent-color: var(--red); }
input[type=file] { width: 100%; font: 700 14px var(--ui); color: var(--muted); background: var(--panel-3); border: 3px dashed var(--border); border-radius: 12px; padding: 10px; cursor: pointer; }
input[type=file]::file-selector-button { font: 900 14px var(--ui); background: var(--accent); color: var(--on-accent); border: 2px solid var(--border); border-radius: 999px; padding: 6px 14px; margin-right: 10px; cursor: pointer; }
.search { position: relative; display: block; }
.search .ic, .search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.search input, .search .input { padding-left: 42px; }
.tabs { display: inline-flex; gap: 4px; background: var(--panel-2); padding: 5px; border-radius: 999px; border: 3px solid var(--border); }
.tab { min-height: 40px; padding: 0 20px; border-radius: 999px; font: 900 15px var(--ui); border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on, .tab.on:hover { background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--border); }
.tab .ic { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px 0 4px; border-radius: 999px; border: 2px solid var(--border); background: var(--panel-3);
  font: 800 13px var(--ui); color: var(--text); cursor: pointer; white-space: nowrap; }
.chip.plain { padding: 0 12px; }
.chip.on { background: var(--text); color: var(--bg); }
.chip.gold { background: var(--accent); color: var(--on-accent); }

/* =====================================================
   TYPES (pastille + médaillon) — classes t-<clé> de TYPE_ICON_KEY
   ===================================================== */
.t-divin { --tc: #f5c542; --tf: #3b2a00; }
.t-tenebres { --tc: #6f45c9; --tf: #ffffff; }
.t-chaos { --tc: #cf2448; --tf: #ffffff; }
.t-combat { --tc: #e07a1f; --tf: #2b1300; }
.t-feu { --tc: #f2562b; --tf: #ffffff; }
.t-eau { --tc: #2f86e3; --tf: #ffffff; }
.t-foudre { --tc: #ffe04a; --tf: #332a00; }
.t-normal { --tc: #9aa1ab; --tf: #1d2026; }
.type { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 3px; border-radius: 999px; background: var(--tc, #9aa1ab); color: var(--tf, #1d2026);
  font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border: 2px solid var(--border); white-space: nowrap; }
.type.sm { height: 22px; font-size: 10px; padding: 0 8px 0 2px; gap: 4px; }
.med { width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .4); display: grid; place-items: center; flex: none; color: var(--tf); }
.type.sm .med { width: 16px; height: 16px; }
.med .ic, .med svg { width: 13px; height: 13px; }
.type.sm .med .ic { width: 11px; height: 11px; }
.medal { width: 30px; height: 30px; border-radius: 50%; background: var(--tc, #9aa1ab); color: var(--tf, #1d2026); border: 2px solid var(--border); display: grid; place-items: center; flex: none; }
.medal .ic, .medal svg { width: 17px; height: 17px; }
.medal.lg { width: 52px; height: 52px; border-width: 3px; }
.medal.lg .ic, .medal.lg svg { width: 28px; height: 28px; }

/* =====================================================
   RARETÉS
   ===================================================== */
.r-commun { --rc: #8a94a3; }
.r-rare { --rc: #3b82f6; }
.r-epique { --rc: #a855f7; }
.r-legendaire { --rc: #f5c542; }
.rar { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.rar::before { content: ""; width: 10px; height: 10px; transform: rotate(45deg); background: var(--rc); border: 2px solid var(--border); border-radius: 2px; flex: none; }

/* =====================================================
   BARRES (PV, XP, stats)
   ===================================================== */
.hp { display: flex; align-items: center; gap: 6px; }
.hp-lab { font-weight: 900; font-size: 11px; background: var(--border); color: var(--accent); padding: 2px 6px; border-radius: 6px; letter-spacing: .04em; }
.hp-track { flex: 1; height: 12px; border-radius: 999px; background: #3a3d4a; border: 2px solid var(--border); overflow: hidden; }
.hp-fill { height: 100%; border-radius: 999px; background: #35c76a; transition: width 1.3s cubic-bezier(.3, .7, .3, 1), background-color .4s; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35); }
.hp-fill.mid { background: #f2c12e; }
.hp-fill.low { background: #ea3f37; }
.xp { height: 5px; background: rgba(0, 0, 0, .18); border-radius: 3px; overflow: hidden; }
.xp i { display: block; height: 100%; background: #3aa5f0; }
.bar { height: 12px; border-radius: 999px; background: var(--panel-2); border: 2px solid var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--tc, var(--accent)); border-radius: 999px; }

/* Silhouette neutre (perso sans image) */
.sil { position: relative; color: rgba(20, 18, 30, .55); }
.sil::before { content: ""; position: absolute; left: 50%; top: 6%; width: 36%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: currentColor; }
.sil::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 80%; height: 50%; transform: translateX(-50%); border-radius: 50% 50% 14% 14% / 70% 70% 14% 14%; background: currentColor; }

/* Image ou emoji d'un perso (avatarHtml) */
.avatar { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 56px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================
   BANDEAU D'AIDE, TABLEAUX, NOTIFICATIONS
   ===================================================== */
.helpbar { display: flex; gap: 20px; align-items: center; justify-content: flex-end; min-height: 40px; padding: 0 24px; background: var(--border); color: #fff; font-weight: 700; font-size: 13px; flex-wrap: wrap; }
.helpbar .key, .helpbar kbd { background: #fff; color: #1e1b26; border-color: #fff; margin-right: 6px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 3px solid var(--border); background: var(--panel-2); }
.tbl td { padding: 12px 14px; border-bottom: 2px solid var(--line); font-weight: 700; }
.tbl tr:last-child td { border-bottom: 0; }

.toasts { position: fixed; top: 86px; left: 50%; translate: -50% 0; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-3); color: var(--text); border: 3px solid var(--border); border-radius: 999px; padding: 10px 20px; font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow); transition: opacity .3s, transform .3s; max-width: min(92vw, 560px); text-align: center; }
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* Animations communes */
.rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(245, 197, 66, .35) 0 8deg, transparent 8deg 20deg); animation: spin 14s linear infinite; border-radius: 50%; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.spark { position: absolute; width: 18px; height: 18px; background: #fff; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: twinkle 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes twinkle { 0%, 100% { transform: scale(.4); opacity: .3; } 50% { transform: scale(1.1); opacity: 1; } }
.shine::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .65) 50%, transparent 60%); animation: shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }
@keyframes blink { to { visibility: hidden; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
main { animation: pageIn .4s cubic-bezier(.2, .9, .3, 1) both; }

/* =====================================================
   MOBILE : en-tête compact + onglets en bas
   ===================================================== */
@media (max-width: 1100px) {
  .hdr { gap: 16px; padding: 0 16px; }
  .user .ub-name { display: none; }
  .nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-i { padding: 0 12px; font-size: 15px; flex: none; }
  .hdr-r { gap: 8px; flex: none; }
}
@media (max-width: 900px) {
  /* Logo réduit au halo pour laisser la place à la navigation */
  .hdr .logo-word { display: none; }
}
@media (max-width: 720px) {
  .hdr { height: 58px; gap: 10px; padding: 0 14px; }
  .hdr .nav { display: none; }
  .logo-word { font-size: 19px; }
  .logo-halo { width: 28px; height: 28px; border-width: 4px; }
  .logo-halo::after { height: 36px; width: 6px; }
  .gems { height: 34px; font-size: 14px; }
  .gem { width: 22px; height: 22px; }
  .hdr .icon-btn { width: 36px; height: 36px; border-width: 2px; }
  .hdr .user { display: none; }
  main { padding: 16px; }
  body.has-tabs { padding-bottom: 70px; }
  .m-tabs { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 70px; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
    background: var(--panel); border-top: 3px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .m-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-weight: 900; font-size: 12px; text-decoration: none; }
  .m-tab:hover { color: var(--text); }
  .m-tab .ic { width: 24px; height: 24px; }
  .m-tab.on { color: var(--red); }
  .m-tab.on .ic { background: var(--red); color: #fff; border-radius: 999px; width: 24px; padding: 3px 14px; box-sizing: content-box; height: 22px; border: 2px solid var(--border); }
  .ptitle { height: 44px; font-size: 20px; padding: 0 40px 0 18px; }
  .ptitle small { display: none; }
  .btn-lg { min-height: 56px; font-size: 19px; padding: 0 24px; }
  .toasts { top: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================
   EXPERIENCE APP (iOS/Android) : pas de zoom auto, pas de flash au tap,
   pas de sélection accidentelle, safe-areas du notch
   ===================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior-y: none;
}
/* La sélection reste possible là où on tape du texte */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }

/* Notch / Dynamic Island : le header ne passe pas dessous */
/* Desktop : rien ne change (72px). Mobile standalone : le header glisse sous le notch. */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 720px) {
    .hdr { padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
    .opening { top: calc(58px + env(safe-area-inset-top)); }
    .toasts { top: calc(70px + env(safe-area-inset-top)); }
    .m-tabs { padding-bottom: calc(env(safe-area-inset-bottom)); }
  }
}

/* Double-tap zoom off sur les boutons : Safari mobile traite 100ms comme un tap rapide */
button, .btn, .chip, .tab, .m-tab, .nav-i, a { touch-action: manipulation; }
