/* Accueil Musicarium = shell EasyDesk plein écran mobile */
.musicarium-home {
  position: fixed;
  inset: 0;
  z-index: 2;
  max-width: none;
  height: 100%;
  height: 100dvh;
  background: var(--ed-bg);
}

.musicarium-home[hidden] {
  display: none !important;
}

.musicarium-home .shell__cols {
  height: 100%;
  max-width: none;
}

.musicarium-home .sidebar {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  box-shadow: none;
}

.musicarium-home .sidebar__chrome {
  flex-shrink: 0;
}

.musicarium-home .sidebar__content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.musicarium-home .wizard {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.musicarium-home .chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.musicarium-home .chat__thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.musicarium-home .musicarium-home__brand {
  flex: 1;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ed-chrome-fg);
}

/* Réglages = tiroir plein écran (mobile) */
.musicarium-home .shell__cols {
  position: relative;
}

.musicarium-home .llm-settings {
  position: absolute;
  inset: 0;
  z-index: 20;
  width: 100% !important;
  max-width: none !important;
  border: none;
  box-shadow: var(--ed-shadow-card);
  background: var(--ed-bg-card);
}

.musicarium-home .llm-settings[hidden] {
  display: none !important;
}

.gate[hidden] {
  display: none !important;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 3;
}

.gate__main {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(2.5rem, env(safe-area-inset-top))
    1.25rem
    max(1.5rem, env(safe-area-inset-bottom));
}

/* Réafficher le gate au-dessus du fond EasyDesk */
body:has(#gate:not([hidden])) {
  background: #0a0a0c;
}

/* Progression agent live (chargement réponses) */
.chat-msg--progress {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 4px;
  max-width: 100%;
}

.agent-progress {
  font-size: 12px;
  color: var(--ed-text-muted);
  opacity: 0.92;
}

.agent-progress__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.agent-progress__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ed-accent, #009fae);
  box-shadow: 0 0 0 0 rgba(0, 159, 174, 0.45);
  animation: agent-pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}

.agent-progress__title {
  font-family: var(--font-heading, inherit);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ed-text-muted);
}

.agent-progress__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-progress__item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.agent-progress__item--running,
.agent-progress__item--done {
  opacity: 1;
}

.agent-progress__item--pending,
.agent-progress__item--planned {
  opacity: 0.45;
}

.agent-progress__item--error {
  opacity: 1;
  color: #b42318;
}

.agent-progress__mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--ed-border, #c9d4d8);
  background: transparent;
  justify-self: center;
}

.agent-progress__item--running .agent-progress__mark {
  border-color: var(--ed-accent, #009fae);
  background: var(--ed-accent, #009fae);
  animation: agent-mark-blink 1s ease-in-out infinite;
}

.agent-progress__item--done .agent-progress__mark {
  border-color: var(--ed-green, #1a7a4c);
  background: var(--ed-green, #1a7a4c);
}

.agent-progress__item--error .agent-progress__mark {
  border-color: #b42318;
  background: #b42318;
}

.agent-progress__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ed-text, #1a2b30);
}

.agent-progress__meta {
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--ed-text-muted);
}

.agent-progress__item--running .agent-progress__meta {
  color: var(--ed-accent, #009fae);
}

@keyframes agent-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 159, 174, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 159, 174, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 159, 174, 0);
  }
}

@keyframes agent-mark-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agent-progress__pulse,
  .agent-progress__item--running .agent-progress__mark {
    animation: none;
  }
}
