:root {
  color-scheme: dark;
  --bg: #161615; --ink: #1D1D1C; --ink2: #262625; --raised: #2E2E2C; --hover: #363633;
  --sand: #DACFC0; --sand-light: #F4EFE8; --text: #F4EFE8; --paper: var(--ink2);
  --accent: #C44927; --accent-dark: #D65A37; --accent-soft: rgba(196,73,39,.18);
  --green: #3E8C7F; --green-dark: #1F514A; --green-light: #7CC4B6; --green-soft: rgba(62,140,127,.2); --muted: #A39A8E; --line: #393835;
  --font: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
[hidden] { display: none !important; }

.brand { font-weight: 600; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none; }
.brand i { width: 28px; height: 28px; background: currentColor; -webkit-mask: url(/assets/logo.svg) center / contain no-repeat; mask: url(/assets/logo.svg) center / contain no-repeat; display: inline-block; flex: none; }
.brand small { font-weight: 400; opacity: .6; }

.btn { border: 0; border-radius: 6px; padding: 9px 16px; display: inline-flex; align-items: center; gap: 7px; justify-content: center; background: var(--accent); color: #fff; font-weight: 500; cursor: pointer; transition: background .15s; white-space: nowrap; text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--accent); border: 1px solid transparent; }
.btn.danger:hover { border-color: var(--accent); background: transparent; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--text); }
.link.danger:hover { color: var(--accent-dark); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=password], input[type=url], input[type=search], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; background: var(--bg); outline: none; transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--green); }
textarea { resize: vertical; }
.error { color: #E8704E; font-size: 13px; min-height: 18px; margin: 8px 0 0; }

/* Écran de connexion */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate-card { width: 100%; max-width: 400px; background: var(--ink2); border: 1px solid var(--line); border-radius: 8px; padding: 32px; }
.gate-card h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 22px 0 6px; }
.gate-card p.lead { color: var(--muted); margin: 0 0 22px; }
.gate-card .btn { width: 100%; padding: 12px; }

/* Admin */
.topbar { background: var(--ink); color: var(--text); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 56px; flex: none; }
.topbar .spacer { flex: 1; }
.topbar .btn.ghost { color: var(--text); border-color: var(--line); }
.topbar .btn.ghost:hover { background: var(--ink2); }
.wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.wrap .sub { color: var(--muted); margin: 0 0 28px; }
.card { background: var(--ink2); border-radius: 8px; padding: 22px; margin-bottom: 18px; border: 1px solid var(--line); }
.card h2 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head .spacer { flex: 1; }
.share { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 5px; padding: 8px 8px 8px 12px; margin-bottom: 14px; }
.share code { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.pages { list-style: none; margin: 0 0 12px; padding: 0; }
.pages li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.pages li .t { flex: 1; min-width: 0; }
.pages li .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages li .t span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; border-radius: 4px; padding: 2px 8px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.badge.open { background: var(--green-dark); color: #fff; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.card-foot { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* Revue */
.review { height: 100%; display: flex; flex-direction: column; }
.review .topbar { gap: 12px; }
.proj-name { font-weight: 500; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22vw; }
.seg { display: inline-flex; background: var(--ink2); border-radius: 6px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 4px; padding: 6px 13px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--hover); color: var(--text); font-weight: 500; }
select.pick { background: var(--ink2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; max-width: 26vw; font: inherit; font-size: 13px; cursor: pointer; }
.stage { flex: 1; display: flex; min-height: 0; }
.frame-wrap { flex: 1; min-width: 0; background: var(--bg); display: flex; justify-content: center; overflow: auto; position: relative; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; flex: none; transition: width .2s; }
.frame-wrap.tablet iframe { width: 820px; } .frame-wrap.mobile iframe { width: 390px; }
.frame-wrap.tablet, .frame-wrap.mobile { padding: 16px 0 0; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: var(--bg); pointer-events: none; }
.side { width: 360px; flex: none; background: var(--ink); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.side-head h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.tabs { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 4px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.tabs button.on { background: var(--raised); color: var(--text); font-weight: 500; }
.list { flex: 1; overflow-y: auto; padding: 12px; }
.hint { color: var(--muted); font-size: 14px; text-align: center; padding: 34px 18px; }
.hint b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.thread { background: var(--ink2); border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 6px; padding: 12px 12px 10px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.thread:hover { border-color: #4a4844; border-left-color: #4a4844; }
.thread.active { border-color: var(--line); border-left-color: var(--green); background: #2a2928; }
.thread.resolved { opacity: .65; }
.thread.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--green-soft); border-color: var(--green); } to { box-shadow: 0 0 0 0 transparent; } }
.thread.is-draft { background: var(--bg); border: 1px dashed #5a5752; border-left: 3px solid var(--green); cursor: default; }
.t-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.avatar { width: 26px; height: 26px; border-radius: 5px; background: var(--raised); color: var(--sand); font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; letter-spacing: .02em; }
.avatar.studio { background: var(--green-dark); color: #fff; }
.num { width: 26px; height: 26px; border-radius: 5px; background: var(--green-dark); color: #fff; font-size: 13.5px; font-weight: 600; display: grid; place-items: center; flex: none; font-variant-numeric: tabular-nums; }
.thread.resolved .num { background: var(--raised); color: var(--muted); }
.num.draft { width: 26px; height: 26px; border-radius: 5px; background: transparent; border: 1.5px dashed var(--green-light); color: var(--green-light); color: #fff; font-size: 15px; display: grid; place-items: center; margin: 0; }
.who { font-weight: 500; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who em { font-style: normal; font-size: 11px; background: var(--raised); color: var(--sand); border-radius: 3px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.when { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.is-draft .when { margin-left: auto; color: var(--green-light); font-weight: 500; }
.on-el { font-size: 11px; color: #6E6962; margin: -4px 0 6px 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .01em; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-left: 34px; color: var(--text); }
.t-actions { display: flex; gap: 14px; margin: 8px 0 0 34px; align-items: center; min-height: 26px; }
.t-actions .spacer { flex: 1; }
.t-actions .link { text-decoration: none; font-size: 13px; }
.resolve { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #5a5752; background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: all .15s; }
.resolve svg { width: 15px; height: 15px; stroke-width: 2.2; }
.resolve:hover { border-color: var(--green); color: var(--green); }
.resolve.on { background: var(--green); border-color: var(--green); color: #fff; }
.replies { margin: 10px 0 0 34px; padding-left: 12px; border-left: 2px solid var(--line); }
.reply { margin-bottom: 10px; }
.reply .t-head { margin-bottom: 2px; }
.reply .avatar { width: 22px; height: 22px; font-size: 10px; }
.reply .body, .reply .t-actions { margin-left: 30px; }
.reply .composer { margin-left: 0; }
/* Zone de saisie */
.composer { margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--ink); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.thread > .composer.reply, .thread > .composer.edit { margin-left: 34px; }
.composer textarea { border: 0; background: transparent; padding: 10px 12px 4px; font-size: 14px; resize: none; display: block; min-height: 52px; }
.composer textarea:focus { border: 0; }
.c-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 4px 6px 6px; }
.btn.send { width: 32px; height: 32px; padding: 0; flex: none; }
.btn.send .ph { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.btn.send:disabled { background: var(--raised); color: var(--muted); opacity: 1; }
.btn.send.busy { opacity: .6; }
.c-foot .btn.ghost { border-color: transparent; color: var(--muted); }
.c-foot .btn.ghost:hover { color: var(--text); background: var(--raised); }
.c-err { color: #E8704E; font-size: 12px; padding: 0 12px; }
.c-err:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--sand-light); color: var(--ink); font-weight: 500; padding: 10px 18px; border-radius: 6px; font-size: 14px; z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

/* ---------- Coquille admin ---------- */
.shell { height: 100%; display: flex; }
.sidebar { width: 236px; flex: none; background: var(--ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 10px; gap: 2px; min-height: 0; }
.sidebar .brand { padding: 4px 10px 18px; color: var(--text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .recent a, .nav-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; color: var(--muted); text-decoration: none; font-size: 14px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.nav a:hover, .recent a:hover, .nav-foot:hover { background: var(--ink2); color: var(--text); }
.nav a.on, .recent a.on { background: var(--raised); color: var(--text); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 10px 6px; }
.recent { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 1px; }
.recent a { padding: 7px 10px; font-size: 13.5px; }
.recent .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .cnt { font-size: 11px; background: var(--green-dark); color: #fff; border-radius: 4px; padding: 0 6px; line-height: 18px; }
.recent-empty { color: var(--muted); font-size: 13px; padding: 4px 10px; margin: 0; }
.nav-foot { margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--muted); }
.main { flex: 1; min-width: 0; overflow-y: auto; }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 32px 80px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.page-head .spacer, .page-head .grow { flex: 1; min-width: 0; }
.crumb { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.crumb a { text-decoration: none; } .crumb a:hover { color: var(--text); }
.back { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); flex: none; }
.back:hover { background: var(--ink2); }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .tabs button { font-size: 13px; padding: 5px 12px; }
.tabs .n { margin-left: 6px; opacity: .6; font-size: 11px; }
input.search { width: 240px; padding: 7px 12px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.card-head .muted { margin-left: auto; }

/* Grille de projets */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid .empty { grid-column: 1 / -1; }
.pcard { background: var(--ink2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-decoration: none; transition: border-color .15s; outline: none; }
.pcard:hover, .pcard:focus-visible { border-color: #5a5752; }
.pcard:focus-visible { box-shadow: 0 0 0 3px var(--green-soft); }
.cover { position: relative; aspect-ratio: 16 / 10; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; }
.cover.c0 { background: linear-gradient(140deg, #3E8C7F 0%, #1F514A 50%, #16302c 100%); }
.cover.c1 { background: linear-gradient(140deg, #2a6b61 0%, #1F514A 45%, #1d1d1c 100%); }
.cover.c2 { background: linear-gradient(140deg, #DACFC0 0%, #8f7f6c 50%, #2e2a26 100%); }
.cover.c3 { background: linear-gradient(140deg, #4a4843 0%, #333332 45%, #1F514A 120%); }
.cover { overflow: hidden; }
.thumb { position: absolute; inset: 0; overflow: hidden; background: #fff; opacity: 0; transition: opacity .35s; pointer-events: none; }
.thumb.ready { opacity: 1; }
.thumb iframe { width: 1280px; height: 800px; border: 0; transform: scale(var(--s, .2)); transform-origin: 0 0; pointer-events: none; }
.cover.has-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(18,18,17,.55) 62%, rgba(18,18,17,.92) 100%); pointer-events: none; }
.cover > .ini, .cover > .badge, .cover > .cover-t { position: relative; z-index: 1; }
.cover > .ini, .cover > .badge { position: absolute; }
.cover .ini { position: absolute; top: 12px; left: 14px; font-weight: 600; font-size: 13px; letter-spacing: .04em; color: rgba(255,255,255,.9); background: rgba(0,0,0,.28); border-radius: 4px; padding: 3px 7px; }
.cover .badge { position: absolute; top: 12px; right: 12px; }
.cover-t b { display: block; font-size: 17px; font-weight: 600; color: #fff; letter-spacing: -0.01em; text-shadow: 0 1px 8px rgba(0,0,0,.35); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-t span { font-size: 12.5px; color: rgba(255,255,255,.78); }
.pcard-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--muted); }
.pcard.add { align-items: center; justify-content: center; gap: 12px; min-height: 230px; color: var(--muted); font-size: 14px; border-style: dashed; background: transparent; }
.pcard.add:hover { color: var(--text); }
.add-ic { width: 46px; height: 46px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; }

/* Statut */
select.status { appearance: none; -webkit-appearance: none; border: 0; border-radius: 4px; padding: 4px 26px 4px 10px; font-size: 12.5px; font-weight: 500; cursor: pointer; align-self: flex-start;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23F4EFE8' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 14px; }
select.status option { background: var(--ink2); color: var(--text); }
.page-head select.status { height: 40px; padding: 0 32px 0 14px; font-size: 14px; align-self: center; }
.page-head .btn { height: 40px; padding-top: 0; padding-bottom: 0; }
.s-draft { background-color: var(--raised); color: var(--sand); }
.s-client_review { background-color: var(--green-soft); color: var(--green-light); }
.s-fixing { background-color: rgba(218,207,192,.16); color: var(--sand-light); }
.s-done { background-color: var(--green-dark); color: #E6F2EF; }
.dot.s-draft { background: #6b665f; } .dot.s-client_review { background: var(--green-light); } .dot.s-fixing { background: var(--sand); } .dot.s-done { background: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green); }
.status-tag { font-size: 12px; font-weight: 500; border-radius: 4px; padding: 3px 9px; white-space: nowrap; flex: none; }

/* Page projet */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.split .col .card { margin-bottom: 18px; }
.card.narrow { max-width: 620px; }
.pages li { padding: 0; gap: 4px; }
.pages li .pg { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 8px; margin: 0 -8px; border-radius: 5px; text-decoration: none; }
.pages li .pg:hover { background: var(--raised); }
.pages .go { color: var(--muted); display: grid; } .pages .pg:hover .go { color: var(--text); }
.icon-btn { width: 32px; height: 32px; flex: none; border: 0; background: transparent; color: var(--muted); border-radius: 5px; cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.share { margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.notice { display: flex; align-items: center; gap: 16px; background: var(--green-soft); border: 1px solid rgba(62,140,127,.45); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; flex-wrap: wrap; }
.notice > div { flex: 1; min-width: 220px; }
.notice p { margin: 2px 0 0; font-size: 13.5px; color: var(--sand); }
.notice code { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, Consolas, monospace; color: var(--text); }
.back.sm { width: 32px; height: 32px; }

@media (max-width: 860px) {
  .stage { flex-direction: column; }
  .side { width: 100%; height: 42%; border-left: 0; border-top: 1px solid var(--line); }
  .devices, .proj-name, .brand small { display: none; }
  select.pick { max-width: 40vw; }
}

@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 8px 12px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 8px 0 0; }
  .sidebar .nav { flex-direction: row; flex: 1; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .nav-label, .recent { display: none; }
  .nav-foot { width: auto; margin: 0; font-size: 0; gap: 0; }
  .page { padding: 20px 16px 60px; }
  .page-head h1 { font-size: 22px; }
  input.search { width: 100%; }
  .toolbar .spacer { display: none; }
}
@media (max-width: 480px) { .sidebar .brand { font-size: 0; gap: 0; } .nav a { font-size: 12.5px; gap: 6px; } }

/* ---------- Boîtes de dialogue ---------- */
.rv-dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--ink2); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.rv-dialog::backdrop { background: rgba(10,10,9,.62); backdrop-filter: blur(2px); }
.rv-dialog[open] { animation: dlg-in .16s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.rv-dialog form { padding: 20px 20px 16px; }
.rv-dialog h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.rv-dialog p { margin: 0 0 4px; color: var(--sand); font-size: 14px; line-height: 1.5; }
.rv-dialog input { margin-top: 12px; }
.rv-dialog-err { color: #E8704E; font-size: 12.5px; min-height: 0; margin-top: 6px; }
.rv-dialog-err:empty { display: none; }
.rv-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.rv-dialog.danger { border-top: 3px solid var(--accent); }
.btn.btn-danger { background: var(--accent); }

/* ---------- Motif topographique (touches légères) ---------- */
.gate, .sidebar, .pcard.add { position: relative; isolation: isolate; }
.loading { isolation: isolate; }
.gate::before, .sidebar::before, .pcard.add::before, .loading::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url(/assets/topo.png) center / cover no-repeat;
}
/* Connexion : motif bien visible autour de la carte, qui s'efface au centre. */
.gate::before { opacity: .09; -webkit-mask-image: radial-gradient(ellipse at center, transparent 18%, #000 75%); mask-image: radial-gradient(ellipse at center, transparent 18%, #000 75%); }
/* Barre latérale : motif en haut, qui s’efface vers le bas. */
.sidebar::before { opacity: .07; background-size: 900px auto; background-position: 30% 0; -webkit-mask-image: linear-gradient(0deg, transparent 45%, #000 100%); mask-image: linear-gradient(0deg, transparent 45%, #000 100%); }
.sidebar > * { position: relative; }
/* Carte « Nouveau projet » et chargement de la page à relire. */
.pcard.add::before { opacity: .05; background-size: 700px auto; transition: opacity .2s; }
.pcard.add:hover::before { opacity: .09; }
.loading::before { opacity: .05; }
/* Liste de commentaires vide. */
.hint { position: relative; }
.hint::before { content: ''; display: block; width: 120px; height: 72px; margin: 0 auto 14px; opacity: .14; background: url(/assets/topo.png) center / 260px auto no-repeat;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); border-radius: 8px; }

/* ---------- Afficher / masquer le mot de passe ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 36px; height: 34px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.pw-toggle:hover { color: var(--text); background: var(--raised); }
.pw-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.pw-toggle .ph { width: 19px; height: 19px; fill: currentColor; stroke: none; }
input::-ms-reveal, input::-ms-clear { display: none; }
.field .pw-wrap { display: block; margin: 0; font-size: inherit; font-weight: inherit; }

/* ---------- Barre flottante Commenter / Naviguer ---------- */
.preview { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; }
.preview .frame-wrap { flex: 1; }
.mode-bar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 5; padding: 4px; gap: 2px; background: rgba(29,29,28,.92); border: 1px solid #45433f; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.mode-bar button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 14px; border-radius: 5px; }
.mode-bar button .ph { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.mode-bar button.on { background: var(--green-dark); color: #fff; }
.mode-bar button:not(.on):hover { color: var(--text); background: var(--raised); }
@media (max-width: 860px) { .mode-bar { bottom: 12px; } .mode-bar button { padding: 8px 12px; font-size: 13px; } }
