/* Direction : nuit bleue, filets fins, peu d'ombres, couleur réservée aux actions et aux états.
   Un seul moment fort : le vinyle qui tourne pendant la lecture. */
:root {
  --bg: #0c1230;
  --bg2: #121a42;
  --bg3: #1a2358;
  --ink: #f4f2ff;
  --muted: #9aa5d4;
  --soft: #d3d9fa;
  --line: #27326f;
  --deep: #050820;
  --coral: #ff6b5e;
  --sun: #ffd23f;
  --mint: #3ee6b0;
  --violet: #a283ff;
  --f-display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --f-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
img { max-width: 100%; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  margin: 0;
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}

.wrap { max-width: 1000px; margin: 0 auto; }

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); }
p { margin: 0; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
}

.grow { flex: 1 1 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--bg3); color: var(--ink);
  font-weight: 700; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn-sun { background: var(--sun); color: var(--deep); }
.btn-mint { background: var(--mint); color: var(--deep); }
.btn-coral { background: var(--coral); color: var(--deep); }
.btn-danger { background: var(--coral); color: var(--deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg2); filter: none; }
.btn-warn { color: var(--coral); }
.btn-small { min-height: 36px; padding: 4px 14px; font-size: 0.9rem; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 0 6px; }
.brand { font-family: var(--f-display); font-size: 1.4rem; text-decoration: none; color: var(--sun); margin-right: auto; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); background: var(--bg2); }
.nav a.on { color: var(--ink); background: var(--bg2); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 32px; align-items: center;
  padding: 32px 0 40px;
}
.hero h1 {
  font-size: clamp(2.4rem, 7.5vw, 4.2rem); line-height: 1; margin: 10px 0 14px;
  color: var(--sun); overflow-wrap: anywhere;
}
.lead { color: var(--muted); font-size: 1.05rem; max-width: 34em; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 24px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 0; }
.stats dt { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--f-display); font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.stage-art { display: grid; place-items: center; min-height: 220px; }
.disc {
  position: relative; width: min(260px, 70vw); aspect-ratio: 1; max-width: 100%;
  border-radius: 50%;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, var(--bg) 0 2.5%, var(--sun) 3% 6%, var(--coral) 6.5% 19%, var(--deep) 19.5% 21%, transparent 21.5%),
    repeating-radial-gradient(circle at 50% 50%, #0a0f2e 0 2px, #121a4b 2px 4px);
}
.disc::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 25deg, transparent 0 18%, rgba(255,255,255,.1) 24%, transparent 30% 68%, rgba(255,255,255,.07) 74%, transparent 80%);
}
@keyframes spin { to { transform: rotate(360deg); } }
body[data-playing="1"] .disc { animation: spin 2.8s linear infinite; }

/* ---------- Sections ---------- */
section.block { padding: 24px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-head p { color: var(--muted); font-size: 0.95rem; }

.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }

/* ---------- Gestion ---------- */
.admin { margin-bottom: 12px; display: grid; gap: 14px; }
.admin-tag {
  display: inline-flex; align-items: center;
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--deep); background: var(--sun); border-radius: 999px; padding: 2px 10px;
}
.drop {
  display: grid; place-items: center; gap: 4px; text-align: center;
  padding: 26px 16px; border: 1.5px dashed var(--line); border-radius: 14px;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.drop:hover, .drop.over { background: rgba(162, 131, 255, .1); border-color: var(--violet); }
.drop strong { font-family: var(--f-display); font-weight: 400; font-size: 1.2rem; }
.drop span { color: var(--muted); font-size: 0.9rem; }
.drop svg { width: 30px; height: 30px; color: var(--violet); }

.stages { display: grid; gap: 12px; margin-top: 14px; }
.stage { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 14px; }
.stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-file { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); min-width: 0; overflow-wrap: anywhere; margin-right: auto; }
.status { font-family: var(--f-mono); font-size: 0.74rem; padding: 2px 10px; border-radius: 999px; background: var(--bg3); color: var(--ink); }
.status.busy { background: var(--violet); color: var(--deep); }
.status.ok { background: var(--mint); color: var(--deep); }
.status.err { background: var(--coral); color: var(--deep); }
.stage audio { width: 100%; height: 36px; }

.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > label, .field > .lbl { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.span2 { grid-column: span 2; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 8px 12px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sun); outline: none; box-shadow: 0 0 0 2px rgba(255, 210, 63, .25); }
.src { font-size: 0.76rem; color: var(--mint); min-height: 1.2em; }
.src.edited { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 2px 11px; font-size: 0.82rem; min-height: 28px;
}
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--sun); color: var(--deep); border-color: var(--sun); font-weight: 700; }
.add-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.add-bar .note { color: var(--muted); font-size: 0.92rem; margin-right: auto; }

details.settings > summary { cursor: pointer; font-family: var(--f-display); font-size: 1.15rem; list-style: none; display: flex; align-items: center; gap: 10px; }
details.settings > summary::-webkit-details-marker { display: none; }
details.settings > summary::after { content: "+"; margin-left: auto; color: var(--sun); font-size: 1.4rem; }
details.settings[open] > summary::after { content: "–"; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.settings-grid .wide { grid-column: 1 / -1; }

/* ---------- Catalogue ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 14px; min-height: 34px; font-weight: 500; font-size: 0.92rem; }
.pill:hover { border-color: var(--muted); }
.pill.on { background: var(--violet); color: var(--deep); border-color: var(--violet); font-weight: 700; }

.list { display: grid; gap: 10px; }
.row {
  display: grid; gap: 10px 16px; align-items: center;
  grid-template-columns: 44px minmax(0, 1.5fr) minmax(120px, 1fr) 84px auto;
  grid-template-areas: "play info wave time actions";
  padding: 14px 16px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s ease;
}
.row.is-editing { grid-template-areas: "play info wave time actions" "editor editor editor editor editor"; }
.row.is-current { border-color: rgba(255, 210, 63, .55); }
.play {
  grid-area: play; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--coral); color: var(--deep); border: 0;
  transition: transform .1s ease, filter .15s ease;
}
.play:hover { filter: brightness(1.08); }
.play:active { transform: scale(.96); }
.play svg { width: 18px; height: 18px; }
.play[disabled] { background: var(--bg3); color: var(--muted); cursor: not-allowed; filter: none; }
.row.is-playing .play { background: var(--sun); }
.info { grid-area: info; min-width: 0; }
.info h3 { font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-family: var(--f-mono); font-size: 0.7rem; padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.line { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; line-height: 1.35; color: var(--muted); }
.line + .line { margin-top: 2px; }
.line .who { color: var(--soft); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.freestyle { background: var(--mint); }
.dot.exclusive { background: var(--coral); }
.wave { grid-area: wave; position: relative; height: 38px; cursor: pointer; min-width: 0; }
.wave .bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.wave .bars i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: var(--line); }
.wave .fill { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.wave .fill i { background: var(--coral); }
.row.is-demo .wave { cursor: default; }
.time { grid-area: time; font-family: var(--f-mono); font-size: 0.78rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.actions { grid-area: actions; display: flex; align-items: center; gap: 8px; justify-self: end; }
.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 50%;
}
.iconbtn:hover { color: var(--ink); border-color: var(--muted); }
.iconbtn svg { width: 16px; height: 16px; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.empty strong { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; color: var(--ink); margin-bottom: 6px; }

/* ---------- Éditeur d'une prod ---------- */
.editor { grid-area: editor; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 2px; display: grid; gap: 16px; }
.ed-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.del { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warn { font-size: 0.9rem; color: var(--coral); }

/* ---------- Sélecteur d'extrait ---------- */
.clipwave { position: relative; height: 56px; margin: 8px 12px 0; }
.cframe { position: absolute; inset: 0; overflow: hidden; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; }
.chead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 8px rgba(255, 255, 255, .55); pointer-events: none; }
.cbars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; padding: 0 2px; }
.cbars i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: var(--violet); }
.csel { position: absolute; top: 0; bottom: 0; border: 1.5px solid var(--sun); border-radius: 6px; box-shadow: 0 0 0 100vmax rgba(5, 8, 32, .66); pointer-events: none; }
.chandle {
  position: absolute; top: -4px; bottom: -4px; width: 26px; margin-left: -13px;
  background: none; border: 0; padding: 0; cursor: ew-resize; touch-action: none;
  display: grid; place-items: center;
}
.chandle::before { content: ""; width: 6px; height: 64%; border-radius: 3px; background: var(--sun); }
.chandle:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 6px; }
.cliprow { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 12px; }
.cplay {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; border: 0;
  background: var(--sun); color: var(--deep);
  transition: transform .1s ease, filter .15s ease;
}
.cplay:hover { filter: brightness(1.08); }
.cplay:active { transform: scale(.96); }
.cplay svg { width: 18px; height: 18px; }
.ctime { font-family: var(--f-mono); font-size: 0.95rem; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 5.6em; }
.cliptxt { font-family: var(--f-mono); font-size: 0.76rem; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--violet); color: var(--deep); border-color: var(--violet); font-weight: 700; }

/* ---------- Licences ---------- */
.licenses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.lic { display: grid; gap: 10px; align-content: start; }
.lic h3 { font-size: 1.25rem; }
.lic .badge { justify-self: start; font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; color: var(--deep); }
.lic:nth-child(1) .badge { background: var(--mint); }
.lic:nth-child(2) .badge { background: var(--coral); }
.lic ul { margin: 0; padding-left: 1.1em; color: var(--muted); display: grid; gap: 4px; }
.lic .price { font-family: var(--f-display); font-size: 1.15rem; margin-top: 4px; }

/* ---------- À propos / contact ---------- */
.about { max-width: 46em; }
.about p { color: var(--muted); font-size: 1.02rem; white-space: pre-line; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.contact h3 { font-size: 1.25rem; margin-bottom: 8px; }
.copyline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.copyline code { font-family: var(--f-mono); font-size: 0.92rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; overflow-wrap: anywhere; min-width: 0; }
.msgbox { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 84px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hint { color: var(--muted); font-size: 0.9rem; }

footer { padding: 24px 0 40px; color: var(--muted); font-size: 0.88rem; display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 24px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  max-width: min(520px, calc(100vw - 32px)); z-index: 30;
  background: var(--sun); color: var(--deep); font-weight: 700;
  border-radius: 12px; padding: 10px 16px;
}
.toast.err { background: var(--coral); }

/* ---------- Petits écrans ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .stage-art { order: -1; min-height: 170px; }
  .disc { width: min(180px, 52vw); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .licenses { grid-template-columns: minmax(0, 1fr); }
  .contact { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .row { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "play info" "wave wave" "time actions"; }
  .row.is-editing { grid-template-areas: "play info" "wave wave" "time actions" "editor editor"; }
  .time { text-align: left; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body[data-playing="1"] .disc { animation: none; }
  .btn, .play { transition: none; }
}

/* ---------- Blocs du site ---------- */
.bk-hero { padding: 0; }
hr.divider { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.box h3 { font-size: 1.25rem; margin-bottom: 6px; }
.box p { color: var(--muted); white-space: pre-line; }
.box .box-cta { margin-top: 14px; }
.box.tone-coral { border-color: var(--coral); }
.box.tone-sun { border-color: var(--sun); }
.box.tone-mint { border-color: var(--mint); }
.box.tone-violet { border-color: var(--violet); }
.box.tone-coral h3 { color: var(--coral); }
.box.tone-sun h3 { color: var(--sun); }
.box.tone-mint h3 { color: var(--mint); }
.box.tone-violet h3 { color: var(--violet); }
.btnrow-bk { display: flex; }
.btnrow-bk.align-center { justify-content: center; }

/* ---------- Édition du site ---------- */
.sitebar-wrap { margin-bottom: 8px; }
.sitebar { display: grid; gap: 12px; }
.sitebar-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs, .pageacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sform { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.sform .field { flex: 1 1 220px; }
.sform .warn { flex: 1 1 100%; }
section.bk.is-manage { position: relative; border: 1px dashed var(--line); border-radius: 16px; padding: 44px 14px 14px; margin: 10px 0; }
section.bk.is-manage.is-editing { border-color: var(--sun); }
.btools { position: absolute; top: 6px; left: 8px; right: 8px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.btype { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: auto; }
.tb { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--line); background: var(--bg2); border-radius: 8px; color: var(--ink); font-size: 0.82rem; display: inline-flex; align-items: center; justify-content: center; }
.tb:hover { border-color: var(--muted); }
.tb[disabled] { opacity: .35; cursor: not-allowed; }
.tb svg { width: 15px; height: 15px; }
.tb.danger { background: var(--coral); color: var(--deep); border-color: var(--coral); font-weight: 700; }
.bed { margin-top: 14px; display: grid; gap: 14px; background: var(--bg); }
.bed h3 { font-size: 1.15rem; }
.btnfield { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; align-items: center; }
.field .lbl em { text-transform: none; letter-spacing: 0; font-style: normal; opacity: .8; }
.check { display: flex; gap: 8px; align-items: center; font-family: var(--f-body) !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 0.95rem !important; color: var(--ink) !important; }
.check input { width: 18px; height: 18px; }
.cardform { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.addrow { display: flex; justify-content: center; margin: 10px 0 24px; }
.picker { margin: 10px 0; display: grid; gap: 12px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.ptype { text-align: left; display: grid; gap: 2px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.ptype strong { font-family: var(--f-display); font-weight: 400; font-size: 1.05rem; }
.ptype span { color: var(--muted); font-size: 0.85rem; }
.ptype:hover:not([disabled]) { border-color: var(--sun); }
.ptype[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) {
  .btnfield { grid-template-columns: minmax(0, 1fr); }
  section.bk.is-manage { padding-inline: 10px; }
}

/* ---------- Mise en page libre : blocs côte à côte ---------- */
#pageview { display: flex; flex-wrap: wrap; column-gap: 14px; align-items: stretch; }
#pageview > * { flex: 1 1 100%; min-width: 0; }
#pageview > .bk.w-twothirds { flex: 1 1 calc(66.666% - 5px); }
#pageview > .bk.w-half { flex: 1 1 calc(50% - 7px); }
#pageview > .bk.w-third { flex: 1 1 calc(33.333% - 10px); }
#pageview > .bk.w-auto { flex: 0 0 auto; max-width: 100%; }
#pageview > .bk.is-editing { flex: 1 1 100%; }
.bk { font-family: var(--f-body); }
.bk.has-bg { padding-inline: 24px; border-radius: 16px; margin-block: 8px; }
.bk.pad-none:not(.is-manage) { padding-block: 0; }
.bk.pad-s:not(.is-manage) { padding-block: 8px; }
.bk.pad-l:not(.is-manage) { padding-block: 56px; }
.bk.has-ct h1, .bk.has-ct h2, .bk.has-ct h3 { color: var(--c-title); }
.bk.has-cx p, .bk.has-cx li, .bk.has-cx dt, .bk.has-cx dd, .bk.has-cx .lead, .bk.has-cx .eyebrow { color: var(--c-text); }
.bk.al-center { text-align: center; }
.bk.al-right { text-align: right; }
.bk.al-center .btnrow-bk, .bk.al-center .hero-cta, .bk.al-center .sec-head, .bk.al-center .stats, .bk.al-center .filters { justify-content: center; }
.bk.al-right .btnrow-bk, .bk.al-right .hero-cta, .bk.al-right .sec-head, .bk.al-right .stats, .bk.al-right .filters { justify-content: flex-end; }
.bk.al-center .about { margin-inline: auto; }
.bk.al-right .about { margin-left: auto; }
.bk.al-center .row, .bk.al-right .row { text-align: left; }
.imgfig { margin: 0; }
.imgfig img { display: block; width: 100%; height: auto; }
.imgfig.ratio-16-9 img { aspect-ratio: 16 / 9; object-fit: cover; }
.imgfig.ratio-4-3 img { aspect-ratio: 4 / 3; object-fit: cover; }
.imgfig.ratio-1-1 img { aspect-ratio: 1 / 1; object-fit: cover; }
.imgfig.ratio-3-1 img { aspect-ratio: 3 / 1; object-fit: cover; }
.imgfig.fit-contain img { object-fit: contain; }
.imgfig.rad-m img { border-radius: 16px; }
.imgfig.rad-l img { border-radius: 36px; }
.imgfig.rad-0 img { border-radius: 0; }
.hero-img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 16px; }
.box-img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.imgph { border: 1px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Édition : apparence, images, glisser-déposer ---------- */
.appearance { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.appearance > summary { cursor: pointer; font-weight: 700; }
.appearance .settings-grid { margin-top: 14px; }
.colorrow { display: flex; gap: 8px; align-items: center; }
input[type="color"] { width: 46px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.colorpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.imgfield { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.thumb { height: 64px; width: auto; max-width: 140px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.filebtn { cursor: pointer; position: relative; }
.themeform { display: grid; gap: 14px; margin-top: 4px; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.presets .lbl { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tb.grip { cursor: grab; letter-spacing: 0; }
section.bk.dragging { opacity: .35; }
section.bk.drop-before { box-shadow: 0 -3px 0 var(--sun), -3px 0 0 var(--sun); }
section.bk.drop-after { box-shadow: 0 3px 0 var(--sun), 3px 0 0 var(--sun); }
.pill.drop-on { background: var(--sun); color: var(--deep); border-color: var(--sun); }
section.bk.is-manage.w-auto, section.bk.is-manage.w-third { min-width: min(100%, 260px); }
.w-third .btype, .w-auto .btype { display: none; }
@media (max-width: 760px) {
  #pageview > .bk[class*="w-"]:not(.w-auto) { flex-basis: 100%; }
  .colorpair { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Ciel étoilé ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
html.sky-on { background: var(--bg); }
html.sky-on body { background: transparent; }
html.sky-on .card, html.sky-on .row { background: color-mix(in srgb, var(--bg2) 78%, transparent); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }

/* Liste des prods défilante */
.list.scroll-s, .list.scroll-m, .list.scroll-l { overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; align-content: start; }
.list.scroll-s { max-height: min(340px, 70vh); }
.list.scroll-m { max-height: min(520px, 75vh); }
.list.scroll-l { max-height: min(760px, 80vh); }
.list.scroll-s::-webkit-scrollbar, .list.scroll-m::-webkit-scrollbar, .list.scroll-l::-webkit-scrollbar { width: 8px; }
.list.scroll-s::-webkit-scrollbar-thumb, .list.scroll-m::-webkit-scrollbar-thumb, .list.scroll-l::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* Sélecteur de thème visiteur */
.top .nav { margin-right: auto; }
.themewrap { position: relative; }
.themewrap .btn svg { width: 16px; height: 16px; margin-right: 6px; }
.thememenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.35); display: grid; gap: 2px; }
.themeitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 0.92rem; cursor: pointer; text-align: left; }
.themeitem:hover { background: var(--bg); }
.themeitem[aria-checked="true"] { outline: 2px solid var(--sun); outline-offset: -2px; }
.themeitem .sw { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.themeitem .sw i { display: block; width: 12px; height: 18px; }
.themeform .settings-grid { margin-bottom: 10px; }

/* Favoris (côté visiteur) */
.favbtn svg { width: 16px; height: 16px; margin-right: 6px; }
.favn { margin-left: 6px; min-width: 1.3em; padding: 0 6px; border-radius: 999px; background: var(--sun); color: var(--bg); font-size: 0.75rem; font-weight: 700; line-height: 1.5; text-align: center; }
.favn:empty { display: none; }
.favstar { color: var(--muted); }
.favstar svg { width: 22px; height: 22px; }
.favstar:hover { color: var(--sun); }
.favstar.on { color: var(--sun); }
.favstar.on svg { fill: currentColor; }

/* Favoris : fenêtre sous le bouton */
.favwrap { position: relative; }
.favbtn[aria-expanded="true"] { border-color: var(--sun); color: var(--sun); }
.favmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(340px, calc(100vw - 32px)); max-height: min(420px, 70vh); overflow-y: auto; padding: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.35); display: grid; gap: 2px; scrollbar-width: thin; }
.favitem { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 10px; }
.favitem:hover { background: var(--bg); }
.favgo { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 6px 8px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.favgo strong { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favgo small { color: var(--muted); font-size: 0.8rem; }
.favempty { margin: 0; padding: 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.mailbtn:hover { color: var(--sun); }
.row.flash { animation: rowflash 1.5s ease; }
@keyframes rowflash { 0%, 60% { box-shadow: 0 0 0 2px var(--sun); } 100% { box-shadow: 0 0 0 2px transparent; } }
.fsep { flex-basis: 100%; height: 0; }

@media (max-width: 640px) {
  .top { position: relative; }
  .themewrap, .favwrap { position: static; }
  .favmenu, .thememenu { left: 0; right: 0; width: auto; top: 100%; margin-top: 6px; }
}
