.hm-wrap {
  --hm-ink: #182239;
  --hm-muted: #627087;
  --hm-purple: #6746dc;
  --hm-purple-dark: #4b2db4;
  --hm-cyan: #08bfe7;
  --hm-line: #dfe3ee;
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 18px;
  color: var(--hm-ink);
  font-family: Poppins, system-ui, sans-serif;
  user-select: text;
  box-sizing: border-box;
  position: relative;
}

.hm-wrap * { box-sizing: border-box; }
.hm-wrap [hidden] { display: none !important; }
.hm-wrap a { color: #5434c8; }
.hm-wrap button,
.hm-wrap input,
.hm-wrap select,
.hm-wrap textarea { font: inherit; }
.hm-wrap button { cursor: pointer; }
.hm-wrap button:disabled { cursor: default; opacity: .55; }
.hm-wrap :focus-visible { outline: 3px solid var(--hm-cyan); outline-offset: 3px; }

.hm-hero {
  color: #fff;
  padding: 38px 4px 28px;
  position: relative;
}

.hm-hero h1 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -1.4px;
  margin: 12px 0;
}

.hm-hero p { max-width: 700px; color: #e1dfeb; line-height: 1.8; }
.hm-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; display: block; margin-bottom: 8px; }

.hm-wrap .hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--hm-line);
  background: #fff;
  color: var(--hm-ink);
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.hm-wrap .hm-btn:hover { border-color: var(--hm-purple); background: #f2edff; transform: translateY(-1px); }
.hm-wrap .hm-primary { background: linear-gradient(135deg, #7550ef, var(--hm-purple-dark)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(103,70,220,.2); }
.hm-wrap .hm-primary:hover { background: linear-gradient(135deg, #6840df, #42239f); color: #fff; }
.hm-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.hm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.hm-tabs {
  display: flex;
  padding: 4px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(221,225,237,.9);
  border-radius: 13px;
  gap: 4px;
  box-shadow: 0 8px 22px rgba(22,28,52,.08);
}

.hm-tabs a { color: var(--hm-muted); padding: 10px 15px; text-decoration: none; font-size: 13px; border-radius: 9px; }
.hm-tabs a.is-active { background: linear-gradient(135deg, #7652e8, #5530bd); color: #fff; font-weight: 700; box-shadow: 0 5px 13px rgba(89,48,190,.23); }
.hm-btn[aria-pressed="true"] { background: #eae3ff; color: #4f30af; border-color: #a68fea; }

.hm-player-anchor { position: relative; min-width: 0; }

.hm-player {
  padding: 25px;
  background: linear-gradient(125deg, #fff 0%, #f6f1ff 58%, #edf8ff 100%);
  border: 1px solid #dcd9f1;
  border-radius: 20px;
  margin: 18px 0 26px;
  box-shadow: 0 15px 34px rgba(42,31,96,.1);
  position: relative;
  overflow: hidden;
}

.hm-player::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -105px;
  top: -135px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103,70,220,.2), rgba(103,70,220,0) 70%);
  pointer-events: none;
}

.hm-player > * { position: relative; z-index: 1; }
.hm-player-brand { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; max-width: 820px; }
.hm-player-mark { color: #7454cf; font-size: 54px; line-height: .9; transform: rotate(-8deg); opacity: .8; }
.hm-player h2 { font-size: 23px; line-height: 1.25; font-weight: 700; margin: 0 0 8px; }
.hm-player p { line-height: 1.7; }
.hm-player-intro > p:not(.hm-small) { margin: 0 0 18px; }
.hm-small { font-size: 11px; line-height: 1.7; margin: 10px 0 0; color: var(--hm-muted); }
.hm-player-intro > .hm-small { max-width: 650px; }
.hm-playing { margin-top: 20px; max-width: 860px; }
.hm-player-media { min-width: 0; }
.hm-video { width: 100%; aspect-ratio: 16 / 9; min-height: 210px; background: #111; border-radius: 13px; overflow: hidden; box-shadow: 0 11px 24px rgba(7,11,30,.18); }
.hm-video iframe { display: block; width: 100%; height: 100%; min-height: 210px; border: 0; }
.hm-player-details { min-width: 0; }
.hm-player-current { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 12px 0 10px; }
.hm-player-cover { width: 45px; height: 45px; flex: 0 0 45px; display: block; object-fit: cover; border-radius: 10px; border: 1px solid #d7d1ee; background: #ece8fa; }
.hm-player-current-copy { min-width: 0; }
.hm-player-kicker { display: block; color: #6945b1; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.hm-playing [data-hm-now] { font-weight: 700; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-player-actions { gap: 7px; }
.hm-player-actions .hm-btn { padding: 8px 11px; font-size: 12px; }
.hm-player-icon { line-height: 1; }
.hm-status:empty { display: none; }
.hm-status { padding-top: 10px; color: #8c4518; font-size: 12px; margin: 0; }

.hm-toolbar label { font-size: 12px; font-weight: 600; color: #fff; display: block; }
.hm-search { flex: 1; min-width: 240px; }
.hm-wrap input,
.hm-wrap select,
.hm-wrap textarea { display: block; border: 1px solid #cbd2dd; border-radius: 9px; background: #fff; color: var(--hm-ink); padding: 9px 11px; width: 100%; margin-top: 7px; max-width: 100%; }
.hm-edition { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.hm-edition label { width: 100%; }
.hm-edition select { width: auto; max-width: 250px; margin: 0; }
.hm-muted { font-size: 12px; line-height: 1.8; color: #e2e5ee; }

.hm-tracks { display: grid; gap: 12px; }

.hm-track {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 52px 80px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 18px 15px;
  background: linear-gradient(132deg, #fff 0%, #fbfaff 53%, #eff8ff 100%);
  border: 1px solid #dcd9f1;
  border-radius: 18px;
  scroll-margin-top: 24px;
  box-shadow: 0 9px 22px rgba(28,35,71,.09);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hm-track:hover { transform: translateY(-2px); border-color: #c8bbed; box-shadow: 0 14px 28px rgba(47,34,111,.13); }
.hm-track::before { content: ""; position: absolute; z-index: -1; inset: 0 auto 0 0; width: 5px; background: linear-gradient(180deg, #7550ef, #09bee6); }
.hm-track:nth-child(3n+2)::before { background: linear-gradient(180deg, #ff7198, #ffb14a); }
.hm-track:nth-child(3n+3)::before { background: linear-gradient(180deg, #08bca7, #6375f2); }
.hm-track::after { content: ""; position: absolute; z-index: -1; width: 230px; height: 230px; right: -130px; bottom: -145px; border-radius: 50%; background: radial-gradient(circle, rgba(8,191,231,.17), rgba(8,191,231,0) 70%); pointer-events: none; }
.hm-track > * { position: relative; z-index: 1; }
.hm-rank { display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 1px; }
.hm-rank strong { min-width: 45px; padding: 7px 6px; border-radius: 11px; background: linear-gradient(145deg, #162341, #303b71); color: #fff !important; font-size: 18px; line-height: 1; letter-spacing: -.7px; text-align: center; box-shadow: 0 6px 12px rgba(22,35,65,.18); }
.hm-delta { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.hm-delta.up { color: #166b4a; background: #def4e7; }
.hm-delta.down { color: #a23145; background: #ffe5e9; }
.hm-delta.new { color: #6843c1; background: #ece4ff; }
.hm-delta.same { color: #667085; background: #f0f2f6; }

.hm-art { width: 80px; height: 80px; display: grid; place-items: center; overflow: hidden; border-radius: 15px; background: linear-gradient(145deg, #f1ebff, #dff6ff); color: #7555bd; font-size: 38px; box-shadow: inset 0 0 0 1px rgba(103,70,220,.12), 0 8px 15px rgba(65,48,130,.14); }
.hm-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-art span { line-height: 1; }
.hm-track-body { min-width: 0; }
.hm-track-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; min-width: 0; }
.hm-track-copy { min-width: 0; }
.hm-track .hm-eyebrow { color: #6945b1; letter-spacing: 1px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-track h2 { font-size: 20px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; overflow-wrap: anywhere; }
.hm-artist { font-size: 14px; margin: 0 0 4px; }
.hm-meta { font-size: 11px; color: var(--hm-muted); margin: 0 0 4px; overflow-wrap: anywhere; }
.hm-songwriter { max-width: 850px; }
.hm-track-actions { flex: 0 0 auto; justify-content: flex-end; align-self: center; white-space: nowrap; }
.hm-track-actions .hm-btn { padding: 8px 12px; }
.hm-link { font-size: 12px; text-decoration: none; white-space: nowrap; }

.hm-track-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, auto); align-items: start; gap: 18px; border-top: 1px solid rgba(116,100,173,.17); margin-top: 11px; padding-top: 10px; }
.hm-details { min-width: 0; margin: 0; padding: 0; border: 0; font-size: 12px; }
.hm-details summary { display: inline-flex; cursor: pointer; color: #5c4a8d; font-weight: 600; padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.72); }
.hm-details summary:hover { background: #eee8ff; color: #4b2db4; }
.hm-details p { line-height: 1.7; margin: 10px 0 0; }
.hm-note { white-space: normal; overflow-wrap: anywhere; }
.hm-history { max-height: 180px; overflow: auto; margin-top: 7px; }
.hm-history table { width: 100%; border-collapse: collapse; }
.hm-history td, .hm-history th { padding: 6px 7px; text-align: left; border-bottom: 1px solid #eceef4; }
.hm-reaction-block { min-width: 0; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; }
.hm-reactions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; margin: 0; }
.hm-reactions button { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,.78); border: 1px solid #dfe3ee; border-radius: 8px; padding: 5px 8px; font-size: 11px; color: var(--hm-ink); min-height: 33px; }
.hm-reactions button:hover:not(:disabled) { border-color: #9a83e7; background: #f1edff; }
.hm-reactions button > span:first-child { font-size: 16px; }
.hm-reactions button[aria-pressed="true"] { border-color: var(--hm-purple); background: #eee7ff; box-shadow: 0 0 0 1px var(--hm-purple); }
.hm-reactions .hm-remove { font-size: 10px; background: none; border-color: transparent; }
.hm-reaction-login { margin: 7px 0 0; font-size: 11px; line-height: 1.5; }
.hm-reaction-login a { color: #5434c8; text-decoration: underline; text-underline-offset: 3px; }
.hm-reaction-total { text-align: right; margin-top: 5px; }

.hm-tracks[data-hm-layout="grid"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hm-tracks[data-hm-layout="grid"] .hm-track { grid-template-columns: 45px 68px minmax(0, 1fr); gap: 12px; padding: 15px; }
.hm-tracks[data-hm-layout="grid"] .hm-rank strong { min-width: 39px; font-size: 16px;  }
.hm-tracks[data-hm-layout="grid"] .hm-art { width: 68px; height: 68px; border-radius: 13px; font-size: 30px; }
.hm-tracks[data-hm-layout="grid"] .hm-track-body { grid-column: 1 / -1; }
.hm-tracks[data-hm-layout="grid"] .hm-track-head { display: block; }
.hm-tracks[data-hm-layout="grid"] .hm-track-actions { justify-content: flex-start; margin-top: 10px; }
.hm-tracks[data-hm-layout="grid"] .hm-track-lower { grid-template-columns: 1fr; gap: 10px; }
.hm-tracks[data-hm-layout="grid"] .hm-reaction-block { justify-self: stretch; align-items: flex-start; border-top: 1px solid rgba(116,100,173,.17); padding-top: 9px; }
.hm-tracks[data-hm-layout="grid"] .hm-reactions { justify-content: flex-start; }
.hm-tracks[data-hm-layout="grid"] .hm-reaction-total { text-align: left; }

.hm-alert, .hm-notice, .hm-empty { padding: 18px 22px; border-radius: 12px; background: #fff; color: var(--hm-ink); line-height: 1.8; }
.hm-alert { background: #ffe9ed; color: #982e41; }
.hm-notice { background: #e9e2fa; color: #42316d; }
.hm-empty { text-align: center; padding: 42px 24px; }
.hm-home { padding: 0; margin: 24px 0 32px; }
.hm-home > .hm-toolbar { color: #fff; }
.hm-home h2 { font-size: 22px; font-weight: 700; }
.hm-home .hm-player { margin-bottom: 0; }

.hm-admin-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; }
.hm-panel { background: #fff; border-radius: 16px; padding: 26px; margin-bottom: 24px; min-width: 0; }
.hm-panel h2 { font-size: 23px; font-weight: 700; margin-bottom: 18px; }
.hm-panel > p { font-size: 13px; line-height: 1.8; }
.hm-form { display: grid; gap: 16px; }
.hm-form label, .hm-manual-order { font-size: 12px; font-weight: 600; display: block; }
.hm-order { list-style: none; padding: 0; margin: 20px 0; }
.hm-order li { display: grid; grid-template-columns: 32px 42px minmax(0, 1fr) auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid #e5e8f0; align-items: center; }
.hm-order li.dragging { opacity: .5; }
.hm-order li.drag-over { border-top: 3px solid var(--hm-purple); }
.hm-order-number { font-size: 18px; font-weight: 700; color: #7456b9; text-align: center; }
.hm-order-art { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: #f0ebfc; color: #7555bd; font-size: 20px; }
.hm-order-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-order strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.hm-order small { display: block; font-size: 11px; color: var(--hm-muted); margin: 3px 0; overflow-wrap: anywhere; }
.hm-order a { font-size: 11px; }
.hm-order-buttons { display: flex; gap: 5px; }
.hm-order-buttons button { border: 1px solid #ddd; background: #f5f2fc; color: #523680; border-radius: 8px; padding: 7px 10px; }
.hm-editions-list { display: flex; gap: 8px; flex-wrap: wrap; }
.hm-admin .hm-hero .hm-btn { margin-top: 12px; }
.hm-admin .hm-manual-order { margin: 16px 0; }
.hm-admin .hm-panel .hm-eyebrow { color: var(--hm-purple); }

.hm-cover-field { display: grid; gap: 9px; }
.hm-cover-label { font-size: 12px; font-weight: 600; }
.hm-dropzone { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 16px; align-items: center; min-height: 132px; padding: 18px; border: 2px dashed #b9c0cc; border-radius: 14px; background: #f8f9fc; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.hm-dropzone:hover, .hm-dropzone.is-dragover { border-color: var(--hm-purple); background: #f1edff; box-shadow: 0 8px 18px rgba(103,70,220,.08); }
.hm-dropzone:focus-visible { outline: 3px solid var(--hm-cyan); outline-offset: 3px; }
.hm-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hm-dropzone-copy { display: flex; flex-direction: column; gap: 5px; font-size: 11px; line-height: 1.6; color: var(--hm-muted); }
.hm-dropzone-copy strong { font-size: 13px; color: var(--hm-ink); }
.hm-file-name { margin-top: 3px; color: var(--hm-purple); font-weight: 600; overflow-wrap: anywhere; }
.hm-cover-preview { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--hm-line); background: #fff; }
.hm-cover-remove { display: flex !important; align-items: center; gap: 8px; font-size: 11px !important; font-weight: 500 !important; color: #982e41; }
.hm-cover-remove input { width: auto !important; margin: 0 !important; }

/* Le même lecteur reste dans le flux puis devient une mini-barre flottante. */
.hm-player.is-floating {
  position: fixed;
  z-index: 1400;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100vw - 36px));
  max-width: none;
  margin: 0;
  padding: 12px;
  background: linear-gradient(135deg, #111936, #2d1c63 58%, #123d5c);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(4,8,25,.38);
}

.hm-player.is-floating::after { opacity: .55; }
.hm-player.is-floating .hm-player-intro { display: none; }
.hm-player.is-floating .hm-playing { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; align-items: center; margin: 0; max-width: none; }
.hm-player.is-floating .hm-video { width: 82px; height: 82px; min-height: 0; aspect-ratio: 1; border-radius: 12px; box-shadow: 0 8px 18px rgba(0,0,0,.25); }
.hm-player.is-floating .hm-video iframe { min-height: 0; }
.hm-player.is-floating .hm-player-current { margin: 0 0 8px; }
.hm-player.is-floating .hm-player-cover { width: 34px; height: 34px; flex-basis: 34px; border-color: rgba(255,255,255,.22); }
.hm-player.is-floating .hm-player-kicker { color: #b9efff; }
.hm-player.is-floating [data-hm-now] { color: #fff; font-size: 12px; }
.hm-player.is-floating .hm-player-actions { gap: 5px; }
.hm-player.is-floating .hm-player-actions .hm-btn { padding: 7px 8px; font-size: 11px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.22); }
.hm-player.is-floating .hm-player-actions .hm-btn:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.5); }
.hm-player.is-floating .hm-player-actions .hm-primary { background: #7652e8; border-color: #7652e8; }
.hm-player.is-floating .hm-status { color: #d5f4ff; font-size: 10px; padding-top: 8px; }
.hm-has-floating-player { padding-bottom: calc(18px + var(--hm-player-float-height, 0px)) !important; }

@media (max-width: 980px) {
  .hm-tracks[data-hm-layout="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-admin-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hm-track { grid-template-columns: 44px 64px minmax(0, 1fr); gap: 11px; padding: 14px; }
  .hm-art { width: 64px; height: 64px; border-radius: 13px; font-size: 30px; }
  .hm-rank strong { min-width: 40px; font-size: 16px; }
  .hm-track-head { display: block; }
  .hm-track-actions { justify-content: flex-start; margin-top: 10px; }
  .hm-track-lower { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 9px; }
  .hm-reaction-block { justify-self: stretch; align-items: flex-start; border-top: 1px solid rgba(116,100,173,.17); padding-top: 9px; }
  .hm-reactions { justify-content: flex-start; }
  .hm-reaction-total { text-align: left; }
  .hm-order li { grid-template-columns: 28px 38px minmax(0, 1fr) auto; gap: 8px; }
  .hm-order-art { width: 38px; height: 38px; }
}

@media (max-width: 620px) {
  .hm-wrap { padding: 0 12px; margin-top: 12px; }
  .hm-home { padding: 0; }
  .hm-hero { padding: 20px 0; }
  .hm-hero h1 { letter-spacing: -.6px; }
  .hm-tabs { width: 100%; flex-wrap: wrap; }
  .hm-tabs a { flex: 1; text-align: center; padding: 9px 8px; font-size: 12px; }
  .hm-player { padding: 18px; }
  .hm-player-mark { font-size: 42px; }
  .hm-track h2 { font-size: 18px; }
  .hm-reactions button { padding: 5px 7px; }
  .hm-tracks[data-hm-layout="grid"] { grid-template-columns: 1fr; }
  .hm-panel { padding: 18px; }
  .hm-edition { width: 100%; }
  .hm-order li { align-items: start; }
  .hm-order-buttons { flex-direction: column; }
  .hm-video { min-height: 190px; }
  .hm-video iframe { min-height: 190px; }
  .hm-dropzone { grid-template-columns: 1fr; justify-items: start; }
  .hm-cover-preview { width: 110px; height: 110px; }

  .hm-player.is-floating { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; padding: 10px 12px; border-radius: 14px; }
  .hm-player.is-floating .hm-playing { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .hm-player.is-floating .hm-video { width: 58px; height: 58px; }
  .hm-player.is-floating .hm-player-cover { display: none; }
  .hm-player.is-floating .hm-player-current { margin-bottom: 6px; }
  .hm-player.is-floating .hm-player-actions .hm-btn { min-width: 31px; width: 31px; padding: 6px; }
  .hm-player.is-floating .hm-player-label { display: none; }
  .hm-player.is-floating .hm-player-external { display: none; }
  .hm-player.is-floating .hm-player-actions { flex-wrap: nowrap; }
}

.hm-player-actions [data-hm-shuffle][aria-pressed="true"] {
    background: linear-gradient(135deg, #7550ef, #4b2db4);
    color: #fff;
    border-color: #9d87ef;
    box-shadow:
        0 0 0 2px rgba(117, 80, 239, .22),
        0 6px 14px rgba(75, 45, 180, .25);
}