/* Drops — noir et blanc de Hosted, Host Grotesk, clair et sombre suivant le système (?theme=dark|light pour les
   captures). Une seule idée : le drop et ses chiffres ; le QR s'ouvre à part. Contrastes : 21:1 (noir/blanc),
   #4A4A4A sur blanc 8,9:1, #BFC3C9 sur noir 12:1. En-tête et boutons identiques à Canvas. */
:root {
  --bg: #FFFFFF; --fg: #000000; --muted: #4A4A4A; --line: #000000; --soft: #E6E6E6; --surface: #F4F4F4;
  --err: #B00020; --bar-h: 60px; --radius: 14px; --pad: clamp(16px, 3.3vw, 48px);
  font-family: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --fg: #FFFFFF; --muted: #BFC3C9; --line: #FFFFFF; --soft: #2A2A2A; --surface: #141414;
    --err: #FF8A9A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --fg: #FFFFFF; --muted: #BFC3C9; --line: #FFFFFF; --soft: #2A2A2A; --surface: #141414;
  --err: #FF8A9A; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-size: 16px; font-family: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1 { font-size: 32px; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 20px; font-weight: 600; }
h2 { font-size: 22px; line-height: 1.2; margin: 0; font-weight: 600; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.error { color: var(--err); font-size: 14px; margin: 8px 0 0; }

/* En-tête commun des outils Hosted : logo → hosted.art, nom de l'outil. */
.hbar {
  position: sticky; top: 0; z-index: 20; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.hbar-brand { display: flex; align-items: center; gap: 12px; }
.hbar-home, .hbar-tool { color: inherit; text-decoration: none; }
.hbar-home { display: block; line-height: 0; }
.hbar-logo {
  display: block; width: 120px; aspect-ratio: 1790 / 286; background: currentColor;
  -webkit-mask: url(assets/hosted-logo.webp) center / contain no-repeat; mask: url(assets/hosted-logo.webp) center / contain no-repeat;
}
.hbar-tool { font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; padding-left: 12px; border-left: 1px solid var(--line); }
.hbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hbar-email { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.hbar-outbox { font-size: 14px; color: var(--fg); text-underline-offset: 3px; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--fg); border-radius: 999px; background: var(--fg); color: var(--bg);
  font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.pill.ghost { background: transparent; color: var(--fg); }
.pill.big { min-height: 54px; padding: 0 28px; font-size: 16px; width: 100%; }
.pill:disabled { opacity: 0.45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--fg); font-size: 14px; }

/* Accueil (déconnecté) : écran partagé de la vitrine (hosted.art/tools/turn/) — bloc noir à gauche, nom géant à droite. */
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100svh - var(--bar-h)); }
.stage {
  position: sticky; top: var(--bar-h); height: calc(100svh - var(--bar-h));
  background: var(--fg); color: var(--bg); display: grid; place-items: center; align-content: center; gap: 22px; overflow: hidden;
}
.qr-card { margin: 0; background: #fff; color: #000; border-radius: 18px; padding: 22px 22px 18px; display: grid; gap: 12px; justify-items: center; width: min(340px, 64%); }
.qr-card #welcome-qr { width: 100%; line-height: 0; }
.qr-card svg { width: 100%; height: auto; display: block; }
.qr-card figcaption { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.address { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; font-weight: 500; font-size: 15px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.content { display: flex; flex-direction: column; min-width: 0; }
.intro {
  min-height: calc(100svh - var(--bar-h)); display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 48px var(--pad); border-bottom: 1px solid var(--line);
}
.intro > * { margin: 0; }
.crumb { font-size: 15px; font-weight: 500; color: var(--muted); }
.crumb a { color: inherit; text-decoration: none; }
.crumb a:hover { color: var(--fg); }
.giant-word { font-weight: 800; text-transform: uppercase; letter-spacing: -0.05em; line-height: .86; font-size: min(10vw, 16.5svh); margin-left: -0.04em; overflow: hidden; padding-bottom: .04em; }
.intro h1 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; font-size: clamp(28px, 2.9vw, 44px); max-width: 16ch; }
.intro .lead { color: var(--muted); font-size: 19px; line-height: 1.5; max-width: 36ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 6px; }
.cta-row small { font-size: 15px; color: var(--muted); }
.pill.filled.big { width: auto; height: 60px; padding: 0 30px; font-size: 18px; font-weight: 600; }
.feature { padding: clamp(32px, 4.5vw, 56px) var(--pad); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.feature:last-child { border-bottom: 0; }
.feature h3 { margin: 0; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-size: clamp(36px, 4.4vw, 64px); }
.feature p { margin: 0; color: var(--muted); max-width: 40ch; font-size: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .giant-word > span { display: block; animation: rise .9s cubic-bezier(.2, .75, 0, 1) both; }
}
@keyframes rise { from { transform: translateY(105%); } }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .stage { position: relative; top: 0; height: auto; padding: 40px 0 36px; }
  .qr-card { width: min(260px, 64vw); }
  .intro { min-height: 0; padding: 40px var(--pad) 44px; }
  .giant-word { font-size: 23vw; }
}

/* Connecté : formulaire à gauche, drops à droite. */
.layout { display: grid; grid-template-columns: 440px minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.panel { padding: 32px 32px 48px; border-right: 1px solid var(--line); }
.list { padding: 32px 32px 64px; background: var(--surface); min-width: 0; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.empty { color: var(--muted); border: 1.5px dashed var(--soft); border-radius: var(--radius); padding: 32px 20px; text-align: center; margin: 0; }

#form { display: grid; gap: 18px; }
.dropzone { border: 1.5px dashed var(--muted); border-radius: var(--radius); padding: 24px 20px; text-align: center; }
.dropzone.over { border-color: var(--fg); background: var(--surface); }
.dropzone.ok { border-style: solid; border-color: var(--fg); }
.dz-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; overflow-wrap: anywhere; }
.dz-note { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; margin: 0 0 16px; }
.bar span { display: block; height: 100%; width: 0; background: var(--fg); }

.row-cover { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
.cover-pick {
  width: 112px; aspect-ratio: 1; border: 1.5px dashed var(--muted); border-radius: 10px; background: transparent;
  cursor: pointer; padding: 0; overflow: hidden; display: grid; place-items: center; font-size: 14px; font-weight: 500; line-height: 1.25;
}
.cover-pick small { color: var(--muted); font-weight: 400; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-pick:has(img:not([hidden])) { border-style: solid; }
.fields { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.opt { color: var(--muted); font-weight: 400; }
.field input {
  font-size: 16px; min-height: 46px; padding: 0 14px; border: 1px solid var(--muted); border-radius: 10px;
  background: var(--bg); width: 100%; min-width: 0;
}
.field input:focus-visible { outline-offset: 0; border-color: var(--fg); }
/* Comptes SoundCloud à suivre : trois liens au plus, mêmes cases que les autres champs. */
.sc-links { display: grid; gap: 8px; }
.sc-links legend .opt { display: block; }
.sc-links input { font-size: 16px; min-height: 46px; padding: 0 14px; border: 1px solid var(--muted); border-radius: 10px; background: var(--bg); width: 100%; min-width: 0; }
.sc-links input:focus-visible { outline-offset: 0; border-color: var(--fg); }
.sc-links p { margin: 2px 0 0; font-size: 14px; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--soft); border-radius: 999px; font-size: 14px; font-weight: 500;
}
.chip input:checked + span { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.chip input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 3px; }
.chip input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.chip .pro, .collect .pro { font-size: 10px; margin-left: 4px; vertical-align: 2px; font-weight: 700; letter-spacing: 0.12em; padding: 2px 6px; border: 1px solid currentColor; border-radius: 999px; }

/* Un drop. */
.drops { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.drop { background: var(--bg); border: 1px solid var(--soft); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; }
.drop.ended { opacity: 0.8; }
.drop-top { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; }
.drop-cover { width: 72px; aspect-ratio: 1; border-radius: 8px; background: var(--fg); overflow: hidden; }
.drop-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drop-title { font-size: 19px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-artist { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-status { margin: 4px 0 0; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.state { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--fg); }
.state.live { background: var(--fg); color: var(--bg); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--soft); padding-top: 14px; }
.stats div { min-width: 0; }
.stats dt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.collect { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--soft); border-radius: 12px; cursor: pointer; font-size: 15px; line-height: 1.4; }
.collect input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--fg); }
.collect:has(input:checked) { border-color: var(--fg); }
.collect.locked { cursor: default; }
.collect.locked strong { color: var(--muted); }
.stats { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
.stats .of { font-size: 15px; font-weight: 500; color: var(--muted); }
.drop-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drop-actions .pill { min-height: 38px; font-size: 14px; padding: 0 14px; }
.drop-actions .link { margin-left: auto; }

/* Fenêtre du QR. */
dialog {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--bg); color: var(--fg);
  width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
}
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.qr-close { position: absolute; top: 12px; right: 16px; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.qr-preview { background: #fff; display: grid; place-items: center; padding: 40px; border-right: 1px solid var(--soft); }
.qr-preview svg { width: 100%; max-width: 380px; height: auto; display: block; }
.qr-side { padding: 28px 24px; display: grid; gap: 18px; align-content: start; }
.qr-drop { margin: -10px 0 0; }
.qr-actions { display: grid; gap: 8px; }
.qr-link { font-size: 14px; margin: 0; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  /* Sur téléphone, les chiffres d'abord quand il y a des drops. */
  .layout.has-drops .list { order: -1; }
  .layout.has-drops .panel { border-bottom: 0; border-top: 1px solid var(--line); }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 16px 32px; }
  .list { padding: 24px 16px 48px; }
  .hbar { padding: 0 16px; }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-preview { border-right: 0; border-bottom: 1px solid var(--soft); padding: 24px; }
  .qr-preview svg { max-width: 260px; }
}
@media (max-width: 520px) {
  .hbar-logo { width: 92px; }
  .hbar-email, .hbar-outbox { display: none; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .drop-actions .link { margin-left: 0; }
  .row-cover { grid-template-columns: 88px 1fr; }
  .cover-pick { width: 88px; }
}

/* Menu Hosted dans l'en-tête de l'outil (décisions de François, 01/10) : le même partout, Radio · Tools · Label, et
   STUDIO en plus dès qu'on est connecté (studio.hosted.art : tous ses outils), souligné dans un outil. Tools est la
   présentation publique. Connecté = l'e-mail du compte est affiché dans la barre (.hbar-email sans « hidden »).
   Sous 900 px, un seul lien reste : Studio si connecté, Tools sinon. */
.hbar-nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); margin-right: 6px; }
.hbar-nav a { font-weight: 500; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: inherit; white-space: nowrap; padding: 10px 0; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.hbar-nav a:hover, .hbar-nav a[aria-current="page"] { text-decoration-line: underline; }
.hbar-nav .hbar-studio { display: none; }
.hbar:has(.hbar-email:not([hidden])) .hbar-nav .hbar-studio { display: inline; }
@media (max-width: 900px) {
  .hbar-nav a { display: none; }
  .hbar-nav .hbar-tools-link { display: inline; }
  .hbar:has(.hbar-email:not([hidden])) .hbar-nav .hbar-tools-link { display: none; }
}

/* Téléphone (audit du 03/10) : la barre tient sur 360 px, le bouton de compte ne sort plus de l'écran.
   Le nom de l'outil peut se couper (…), le bouton jamais. */
.hbar-brand { min-width: 0; }
.hbar-tool { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-right { flex-shrink: 0; }
@media (max-width: 520px) {
  .hbar { gap: 10px; padding: 0 14px; }
  .hbar-brand { gap: 8px; }
  .hbar-logo { width: 80px; }
  .hbar-tool { font-size: 13px; letter-spacing: 0.1em; padding-left: 8px; }
  .hbar-right { gap: 10px; }
  .hbar-nav { margin-right: 0; }
  .hbar-nav a { font-size: 13px; }
  .hbar-right .pill { min-height: 36px; height: 36px; padding: 0 14px; font-size: 14px; }
}

/* ---------- Menu à gauche (essai du 03/10) : HOSTED | DROPS ▾ (changer d'outil) ; à droite STUDIO + son nom ---------- */
.hbar-switch, .hbar-acct { position: relative; }
.hbar-tool { display: inline-flex; align-items: center; gap: 6px; height: 40px; border: 0; border-left: 1px solid var(--line); background: none; color: inherit; font: inherit; font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.hbar-tool svg, .hbar-acct-btn svg { width: 12px; height: 12px; flex: none; }
.hbar-tool[aria-expanded="true"] svg, .hbar-acct-btn[aria-expanded="true"] svg { rotate: 180deg; }
.hbar-dd { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; display: grid; min-width: 240px; padding: 8px 0; background: var(--bg); border: 1px solid var(--fg); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); }
.hbar-dd[hidden] { display: none; }
.hbar-dd-right { left: auto; right: 0; }
.hbar-dd a, .hbar-dd button { display: block; padding: 10px 18px; border: 0; background: none; color: inherit; font: inherit; font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.hbar-dd a:hover, .hbar-dd button:hover { background: rgba(127, 127, 127, 0.12); }
.hbar-dd a[aria-current="page"] { font-weight: 700; }
.hbar-dd hr { margin: 6px 0; border: 0; border-top: 1px solid rgba(127, 127, 127, 0.3); }
.hbar-dd .hbar-email { display: block; max-width: none; padding: 6px 18px 10px; font-size: 13px; }
.hbar-studio-link { color: inherit; font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.hbar-login { color: inherit; font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; }
.hbar-studio-link:hover, .hbar-login:hover { text-decoration: underline; text-underline-offset: 6px; }
.hbar-acct-btn { gap: 8px; padding-left: 7px; }
.hbar-ini { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 700; }
@media (max-width: 700px) {
  .hbar-studio-link, .hbar-create, .hbar-name, .hbar-acct-btn svg { display: none; }
  .hbar-right .hbar-acct-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .hbar-dd { position: fixed; top: calc(var(--bar-h) + 6px); left: 12px; right: 12px; }
}
