.h5p-espa-milka-ordena-dialogo {
  color: #1f2933;
  font-family: inherit;
}

.h5p-emod-activity {
  box-sizing: border-box;
  max-width: 82rem;
  margin: 0 auto;
  padding: 0.25rem;
}

.h5p-emod-title {
  margin: 0 0 0.55rem;
  color: #3b0a08;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
}

.h5p-emod-instruction {
  margin: 0 0 1.25rem;
  color: #55616f;
  font-size: 1.05rem;
  line-height: 1.45;
}

.h5p-emod-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem);
  align-items: stretch;
  gap: 1rem;
  height: min(78vh, 54rem);
  max-height: 54rem;
  min-height: 32rem;
  overflow: hidden;
}

.h5p-emod-dialogue-box {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.1rem;
  border: 2px dashed #d7b7b7;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 252, 248, 0.96)),
    #fff7ed;
  box-shadow: 0 16px 36px rgba(71, 44, 33, 0.1);
}

.h5p-emod-turn {
  display: grid;
  grid-template-columns: minmax(4.5rem, 7rem) minmax(12rem, 1fr);
  align-items: center;
  gap: 0.7rem;
}

.h5p-emod-turn-right {
  grid-template-columns: minmax(12rem, 1fr) minmax(4.5rem, 7rem);
}

.h5p-emod-turn-right .h5p-emod-speaker {
  grid-column: 2;
}

.h5p-emod-turn-right .h5p-emod-slot {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.h5p-emod-speaker {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.h5p-emod-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  overflow: hidden;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  font-weight: 800;
}

.h5p-emod-turn-right .h5p-emod-avatar {
  background: #b45309;
}

.h5p-emod-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h5p-emod-speaker-name {
  max-width: 100%;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-align: center;
}

.h5p-emod-slot {
  position: relative;
  box-sizing: border-box;
  justify-self: start;
  width: min(100%, 36rem);
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 2px dashed #aeb8c7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  white-space: normal;
}

.h5p-emod-turn-left .h5p-emod-slot::before,
.h5p-emod-turn-right .h5p-emod-slot::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  width: 0.8rem;
  height: 0.8rem;
  border: inherit;
  background: inherit;
  transform: rotate(45deg);
}

.h5p-emod-turn-left .h5p-emod-slot::before {
  left: -0.48rem;
  border-top: 0;
  border-right: 0;
}

.h5p-emod-turn-right .h5p-emod-slot::before {
  right: -0.48rem;
  border-bottom: 0;
  border-left: 0;
}

.h5p-emod-slot:hover,
.h5p-emod-slot:focus,
.h5p-emod-slot-over {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.h5p-emod-slot-filled {
  border-style: solid;
  border-color: #8aa6d9;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
}

.h5p-emod-gap {
  box-sizing: border-box;
  display: inline-block;
  max-width: 12rem;
  min-height: 1.55em;
  margin: 0 0.18em;
  padding: 0.05em 0.3em;
  border: 0;
  border-bottom: 2px solid #64748b;
  border-radius: 4px 4px 0 0;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-weight: 800;
  text-align: center;
  vertical-align: baseline;
}

.h5p-emod-gap:focus {
  border-bottom-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.h5p-emod-gap-correct {
  border-bottom-color: #16a34a;
  background: #dcfce7;
  color: #14532d;
}

.h5p-emod-gap-incorrect {
  border-bottom-color: #ef4444;
  background: #ffe4e6;
  color: #7f1d1d;
}

.h5p-emod-slot-correct {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #14532d;
}

.h5p-emod-slot-prefilled {
  border-color: #d8c18f;
  background: #fff7df;
  color: #4a3412;
  cursor: default;
}

.h5p-emod-slot-prefilled:hover,
.h5p-emod-slot-prefilled:focus {
  border-color: #d8c18f;
  background: #fff7df;
  box-shadow: none;
}

.h5p-emod-slot-incorrect {
  border-color: #ef4444;
  background: #fff1f2;
  color: #7f1d1d;
}

.h5p-emod-bank {
  position: relative;
  z-index: 20;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.85rem;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.h5p-emod-bank-title {
  margin-bottom: 0.55rem;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.h5p-emod-bank-items {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.h5p-emod-phrase {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.48rem 0.75rem;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  cursor: grab;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: left;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.h5p-emod-phrase:active {
  cursor: grabbing;
}

.h5p-emod-phrase:hover,
.h5p-emod-phrase:focus,
.h5p-emod-phrase-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.h5p-emod-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.h5p-emod-button {
  min-height: 2.55rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.h5p-emod-button:hover,
.h5p-emod-button:focus {
  background: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
  outline: none;
}

.h5p-emod-secondary {
  background: #ffffff;
  color: #1d4ed8;
}

.h5p-emod-secondary:hover,
.h5p-emod-secondary:focus {
  background: #eff6ff;
}

.h5p-emod-score {
  margin-top: 0.85rem;
}

.h5p-emod-score-card {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #d7dee8;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.h5p-emod-stars {
  display: flex;
  gap: 0.12rem;
  color: #cbd5e1;
  font-size: 1.35rem;
  line-height: 1;
}

.h5p-emod-star-filled {
  color: #f5b301;
  text-shadow: 0 1px 0 rgba(146, 64, 14, 0.25);
}

.h5p-emod-score-text {
  color: #111827;
  font-weight: 800;
}

.h5p-emod-error {
  padding: 1rem;
  border: 1px solid #ef4444;
  border-radius: 8px;
  background: #fff1f2;
  color: #7f1d1d;
}

@media (max-width: 42rem) {
  .h5p-emod-title {
    font-size: 1.55rem;
  }

  .h5p-emod-dialogue-box {
    padding: 0.8rem;
    max-height: none;
    overflow-y: visible;
  }

  .h5p-emod-workspace {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .h5p-emod-bank {
    max-height: 18rem;
  }

  .h5p-emod-bank-items {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .h5p-emod-phrase {
    width: auto;
  }

  .h5p-emod-turn,
  .h5p-emod-turn-right {
    grid-template-columns: 4rem minmax(0, 1fr);
  }

  .h5p-emod-turn-right .h5p-emod-speaker {
    grid-column: 1;
  }

  .h5p-emod-turn-right .h5p-emod-slot {
    grid-column: 2;
    justify-self: start;
  }

  .h5p-emod-turn-right .h5p-emod-slot::before {
    left: -0.48rem;
    right: auto;
    border-top: 0;
    border-right: 0;
    border-bottom: inherit;
    border-left: inherit;
  }

  .h5p-emod-avatar {
    width: 3rem;
    height: 3rem;
  }

  .h5p-emod-speaker-name {
    font-size: 0.7rem;
  }

  .h5p-emod-slot {
    min-height: 3rem;
    padding: 0.7rem 0.8rem;
    font-size: 0.92rem;
  }

  .h5p-emod-controls {
    align-items: stretch;
    flex-direction: column;
  }
}

