body.jules-rubrique {
  margin: 0;
  background: #f6f3ed;
  color: #242624;
}
.jules-rubrique .music-library {
  box-sizing: border-box;
  width: min(100%, 1240px);
  max-width: none;
  margin: auto;
  padding: clamp(20px, 4vw, 48px) clamp(18px, 5vw, 56px);
}
.music-library h2 {
  font-weight: 650;
  letter-spacing: -.06em;
  line-height: 1;
}
.album-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
}
body:has(.album-dialog[open]) {
  overflow: hidden;
}
.album-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.album img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.album-thumbnail {
  box-shadow: 0 14px 36px #1b221b2b;
}
.album-dialog {
  box-sizing: border-box;
  width: min(calc(100% - 24px), 1120px);
  max-height: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid #2426241a;
  border-radius: 18px;
  background: #fdfcf9;
  color: inherit;
  box-shadow: 0 24px 70px #16181635;
  overscroll-behavior: contain;
}
.album-dialog::backdrop {
  background: #1d211c55;
  backdrop-filter: blur(8px);
}
.album-toolbar {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px clamp(8px, 2vw, 20px);
  background: #fdfcf9;
}
.album-body {
  padding: 0 clamp(12px, 4vw, 36px) clamp(20px, 4vw, 36px);
}
.album-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.album-icon:hover { background: #1d1d1f12; }
.album-icon:disabled { opacity: .4; cursor: default; }
.album-actions:not([hidden]) { display: flex; gap: 4px; }
.album-covers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 24px);
}
.album h2 {
  margin: 28px 0 6px;
  font-size: clamp(2rem, 5.5vw, 4rem);
}
.album-year,
.now-playing {
  margin: 0;
  color: #555954;
}
.album-player {
  margin-top: 22px;
}
.now-playing {
  margin: 12px 0 5px;
}
.album audio {
  display: block;
  width: min(100%, 490px);
}
.album-tracks {
  max-width: 490px;
  margin: 18px 0 0;
  padding-left: 1.6em;
}
.album-tracks li {
  border-top: 1px solid #292e2b24;
}
.album-tracks button {
  width: 100%;
  min-height: 44px;
  padding: 5px 6px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.album-tracks button[aria-current] {
  font-weight: 650;
}
.music-library :focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
.album-tracks li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.album-tracks .delete-track {
  width: auto;
  flex-shrink: 0;
  color: #77352e;
  font-size: .875rem;
}
.album-tracks .delete-track:hover {
  text-decoration: underline;
}
.album-tracks li span {
  display: block;
  padding: 9px 6px;
}
.album-editor {
  margin: 0 0 22px;
}
.album-editor > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  cursor: pointer;
  font-weight: 650;
}
.album-editor > summary::-webkit-details-marker { display: none; }
.album-editor > summary::before {
  content: '';
  width: 14px;
  height: 14px;
  background: linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat;
}
.album-editor[open] > summary::before { background-size: 12px 1.5px, 0 0; }
.album-editor form {
  max-width: 720px;
  margin-top: 15px;
  padding: clamp(15px, 3vw, 28px);
  border: 1px solid #252b2b26;
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}
.album-editor .form-grid label {
  display: block;
  font-weight: 600;
}
.album-editor input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid #252b2b55;
  border-radius: 4px;
  font: inherit;
  font-weight: 400;
}
.album-editor button {
  min-height: 40px;
  border: 1px solid #252b2b55;
  border-radius: 4px;
  padding: 5px 10px;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.album-editor button[type="submit"] {
  background: #252b2b;
  color: #fff;
}
.album-editor button:disabled {
  opacity: .4;
  cursor: default;
}
.track-upload {
  margin-top: 16px;
}
.track-editor {
  padding-left: 1.55em;
}
.track-editor li {
  margin: 5px 0;
}
.track-editor li > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  align-items: center;
  gap: 4px;
}
.track-editor input {
  min-width: 0;
}
.track-editor button {
  min-width: 32px;
}
.album-drag-handle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 6px 0 0 auto;
  border: 1px solid #252b2b40;
  border-radius: 6px;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.album-drag-handle[hidden] { display: none; }
.album.is-drop-target .album-thumbnail {
  outline: 2px solid #252b2b;
  outline-offset: 4px;
}
.form-help,
#album-status {
  margin: 8px 0;
  color: #555954;
  font-size: .875rem;
}

.album-editor > summary {
  border: 1px solid #252b2b55;
  border-radius: 999px;
  padding: 10px 18px;
}
.album-editor form {
  border-radius: 18px;
  box-shadow: 0 16px 40px #252b2b0d;
}
.editor-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.editor-fields legend {
  margin-bottom: 16px;
  font-size: 1.3rem;
  font-weight: 650;
}
.cover-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 16px);
  margin-top: 20px;
}
.cover-field {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.cover-slot {
  display: grid;
  position: relative;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #a8a49a;
  border-radius: 10px;
  background: #f6f3ed;
  color: #555954;
  font-size: 2rem;
}
.cover-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cover-add { z-index: 1; line-height: 1; }
.cover-slot img:not([hidden]) + .cover-add {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #fdfcf9;
  font-size: 1.4rem;
}
.album-editor input[type="file"] {
  position: absolute;
  z-index: 2;
  inset: 0;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.cover-field:hover .cover-slot { border-color: currentColor; }
.cover-field:focus-within .cover-slot,
.track-upload:focus-within {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.track-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #252b2b55;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.track-upload:hover { background: #f6f3ed; }
.track-upload span span { margin-right: 4px; }
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
#album-status:empty { margin: 0; }
.missing-audio { color: #555954; }


.album-dialog-status:empty { display: none; }

.jules-music .jules-bar {
  position: sticky;
  top: 0;
  min-height: var(--jules-bar-height);
  height: auto;
}
.jules-music .jules-tools {
  min-width: 0;
}
.music-mini-player:not([hidden]) {
  display: flex;
  align-items: center;
  min-width: 0;
}
.mini-track {
  max-width: 32ch;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-mini-player button {
  display: grid;
  flex: 0 0 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.music-mini-player button:hover { background: #8882; }
.music-mini-player button:disabled { opacity: .35; cursor: default; }
.music-mini-player svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mini-pause-icon,
.music-mini-player[data-playing="true"] .mini-play-icon { display: none; }
.music-mini-player[data-playing="true"] .mini-pause-icon { display: inline; }

@media (max-width: 680px) {
  .album-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .jules-music .jules-bar:has(.music-mini-player:not([hidden])) {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 10px;
  }
  .jules-music .jules-bar:has(.music-mini-player:not([hidden])) .jules-tools {
    width: 100%;
  }
  .music-mini-player { flex: 1; }
  .mini-track { flex: 1; max-width: none; }
}
